Show Google Adsense after first post in WordPress :
There are several reasons to say WordPress is the best CMS. Mainly it is client friendly,bunch of plugins, themes,SEO friendly and great support.Any thing is possible in WordPress,so here you can learn how to add Google adsense after first post in WordPress blog or home page.In every page this adsence add will appear which results you increase in earnings.Simply follow this tutorial to add Google adsense after first post in any WordPress theme.
Go to Appearances > Editor >Single.php file.
Here's is the code to display Google adsense after post in WordPress
<?php if (have_posts()) : ?> <?php $adcounter = 0; ?> <?php while (have_posts()) : the_post(); ?> <?php if ($count == 1) : ?> //Paste your Google Adsense code here <?php the_excerpt(); ?> <?php else : ?> <?php the_excerpt(); ?> <?php endif; ?> <?php $adcounter++; ?> <?php endwhile; ?> <?php endif; ?>
Code Explanation :
If you want to display google adsense after 2nd post then change the values in above code as below.
<?php if ($adcounter == 2) : ?>
<?php $adcounter = 1; ?>
You can change these values as per your requirement.
Need Help :
We hope this WordPress tutorial helped you learning how to display Google adsense after first post,second post and nth post in any WordPress theme.If you are facing any problem,then share your query in below comment box we will reply as early as possible.