Single post – How to place a horizontal banner right BELOW the sharing buttons?

Posted in: Newspaper
Post count: 70

Hello!

I really can’t figure out how to place a vertical banner here, this position is not available in Theme Panel. Also (trying another way) don’t understand out how to add HTML fields to Single post layout in the TD Composer, is this not possible?

Hopefully it’s possible without complicated coding mods.

Thank you very much.

  • This topic was modified 8 years by xbass.
Post count: 70

edit: must be ofcourse horizontal banner

Post count: 20688

Hi,

That would require some editing of the post template used. Each post template has a corresponding loop-single file (Ex: post template 2->loop-single-2) These files are located in the main theme folder.
Editing one of the templates (in this example post template 2) the structure of the post can be seen.
Now by using a do_shortcode you could place an ad in that position, for all posts that use the mentioned post template, like this
https://www.screencast.com/t/jFW87F2fi
Placing the code above the related articles section will display it as you want
https://www.screencast.com/t/9Xqg9GtAw7
I used the custom ad 1 spot in this example, you can use others if needed and make the modification in the code

<?php echo do_shortcode ('[td_block_ad_box spot_id="custom_ad_1"]'); ?>

Note that this will affect only posts that use the edited post template.

Thanks

Post count: 70

Thanks!

Is that in the Woocommerce folder??

  • This reply was modified 8 years by xbass.
Post count: 70

Edit: found, edited, saved, code added to Custom ad spot 1. Just no ad appearing on single posts.

  • This reply was modified 8 years by xbass.
Post count: 70

How do I know what the used post template is? Is #2 the default one? (using a child theme)

Post count: 70

Fixed, it appeared to be template #5.

Is this right positioned under </article> <!–/.post –> ? (when above it the result is the same)

Final question, how to create more blank space inbetween banner and related articles? link

Post count: 20688

Hi,

You can find what template is used by editing the post, or checking with the inspector
https://www.screencast.com/t/1B5sqCBXGa
The default post template would depend on your settings. IF you have set it like this for all posts
https://www.screencast.com/t/XaIRTCCrplv
Then it would be the one set in the theme panel
https://www.screencast.com/t/VfWBMfyn5ZOM
If you add the code in a post template file as shown, it will be displayed for posts that use that post template.
Placing the shortcode above the related articles code will display it above it, placing it below the related articles will display it below it.
I could give you a code to add some margin between them, please provide a link to the post for a more accurate solution.

Thanks

Viewing 8 posts - 1 through 8 (of 8 total)
The forum ‘Newspaper’ is closed to new topics and replies.