- This topic has 3 replies, 2 voices, and was last updated 4 years, 11 months ago by .
GOOGLE ADSENCE ON HOMEPAGE
You must be logged in to reply to this topic.
Hi great theme, do you know of a way to add google adsence after every 3 post on homepage.Sorry tried lots of plugin to complicated do not understand.
If you couldn’t help me can you please tell me where the home page file to edit
i am looking for the the index.php, home.php or front-page.php to add this code
<?php if(have_posts()): ?>
<?php $count=0; ?>
<?php while( have_posts() ): the_post(); ?>
<?php $count++ ?>
<?php if( $count==3 || $count==6 ): ?>
<div>Ads code here</div>
<h2>” title=”<?php the_title(); ?>”><?php the_title(); ?></h2>
<?php else: ?>
<h2>” title=”<?php the_title(); ?>”><?php the_title(); ?></h2>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>
Hello @Ebuka21
My apologies for not responding to your first post. I must of missed it.
The file you need to edit is the content.php file located in the /loop-templates folder.
I hope that answers your question.
You must be logged in to reply to this topic.