How to add adsense before the featured image?

Posted in: Newspaper
Post count: 23

Hi,

I am using theme’s ad option to display my adsense ads,but how to add adsense before the featured image? (under social media sharing buttons)

Best Regards
mike

Post count: 23312

Hello mike6209,

For achieving that, you have to use do_shotcode method with custom Ad to add this ad where you want. For example, if you are using post template 2, you have to edit loop-single-2.php file and add this snippet of the code -> <?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]')?> in the desired place, before the featured image like this -> http://screencast.com/t/5hhHr99Iv Also, before check the results, please ensure that you have entered the AdSense code in Custom Ad filed like this -> http://screencast.com/t/OnwclhFX

The result you should see here -> http://screencast.com/t/5adXHIiPCYXl

Thank you for the message!

Post count: 23

Thanks Catalin,

Awesome Support, it works perfectly 🙂

Best Regards
mike

Post count: 23312

Hello mike6209,

I am glad that I could help you!

Thank you for your appreciation!

Post count: 14

http://allaboutbelgaum.com/news/railway-budget-2016-proposes-survey-of-new-rail-line-and-electrification/

I did the same thing but now it is not working after udpate to latest version earlier that short code was working

<?php echo do_shortcode(‘[td_ad_box spot_id=”custom_ad_1″]’);?>

Post count: 23312

Hello aabuday,

Please ensure you have followed the correct steps that I gave you above and also, please check again the code to be the same -> <?php echo do_shortcode('[td_block_ad_box spot_id="custom_ad_1"]')?> Your update to the latest version of the theme does not influence the functionality of this code.

Hope this helps!

Thank you for the message!

Post count: 14

block_ad was not there in the earlier code
Now changed working fine
Thanks

Post count: 1

Do I need to make changes to the child-theme or the newspaper theme itself? I want to add it one time (to don’t get disturbed by updates, as the override custom modifications)

Please tell me how to add this using child theme. (What to copy to child-theme directory, I am using sing loop 2, for single post style 2)

Post count: 23312

Hello ktk99,

If you want to make these modifications in the loop single according to your post template used by you and add it in your child theme. For more information about our child theme support, please check here -> https://forum.tagdiv.com/the-child-theme-support-tutorial/

Thanks for your understanding!

Viewing 9 posts - 1 through 9 (of 9 total)
You must be logged in to reply to this topic.