Question 1: How do I put an Adsense ad below the first post and third post on the home page? For my current theme (please visit http://www.livelifehappy.com) I just added the following line in the index.php file under <?php /* Start the Loop */ ?>
line added: <?php $adcounter = 0; ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php if ($adcounter == 1) : ?>
<div style=”text-align: center;”>
<script async src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
<!– 300×250 Home Page Below 1st Post –>
<ins class=”adsbygoogle”
style=”display:inline-block;width:300px;height:250px”
data-ad-client=”ca-pub-xxxxxxxx”
data-ad-slot=”8474826612″></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>
<br>
Question 2: How do I add ads below the title of single post/pages and below content? I tried using the ad box in the theme options but it seems to stretch my 300×250 ads to fit the post box. I’d like it to stay the same. Please visit http://livelifehappy.com/life-quotes/closure-is-such-a-beautiful-thing-not-because-it-helps/ and http://livelifehappy.com/17-rules-for-happiness-being-happy/
***I just need to loop the Adsense ads (under 1st and 3rd post) on the home page and throw an ad that doesn’t resize under the title of post/pages and under the content/social share buttons. I will switch over once I figure out how to do those things.
Thanks
Hello,
In our theme you can place ads wherever you want on the homepage using the adbox element in visual composer. Check the ads section in our docs for more information on the subject: https://forum.tagdiv.com/header-ad/
I am not sure how you want to loop the ads on the homepage as it depends on how you want to set it up. Please provide an example of a homepage and try to provide more details as to how you want your ad to be displayed.
As for the adsense size, you can select it from the ad spot here: http://screencast.com/t/DBR0SnRxCC4a
I hope this helps.
Thank you!
I’m testing the theme here: http://roberttew.com
I’d like to loop the ads on the home page (see http://www.livelifehappy.com) and on all the other numbered pages under the 1st and 3rd post. How can I do this?
For my current theme – I’ve added this code to the index file:
index.php file under <?php /* Start the Loop */ ?>
line added: <?php $adcounter = 0; ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php if ($adcounter == 1) : ?>
<div style=”text-align: center;”>
<script async src=”//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js”></script>
<!– 300×250 Home Page Below 1st Post –>
<ins class=”adsbygoogle”
style=”display:inline-block;width:300px;height:250px”
data-ad-client=”ca-pub-xxxxxxxx”
data-ad-slot=”8474826612″></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>