Adsense between a grid loop of posts?
-
I’m struggling with Adsense codes between posts. First, look the image:
I have a grid of 12 posts in homepage, each row being 3 posts. How could i put Adsense ad on the second post of the first row, then another Adsense code (it’s the same size of container) afer the second row os posts, and, then another Adsese ad at the 11th post.
I know it’s possible but i’m real struggling with that.
INDEX.PHP LOOP:
<?php if ( have_posts() ) : ?> <?php /* Start the Loop */ ?> <?php while ( have_posts() ) : the_post(); ?> <?php get_template_part( 'content', get_post_format() ); ?> <?php endwhile; ?> <?php hct_content_nav( 'nav-below' ); ?> <?php else : ?> <article id="post-0" class="post no-results not-found"> <header class="entry-header"> <h1 class="entry-title"><?php _e( 'Nothing Found', 'hct' ); ?></h1> </header><!-- .entry-header --> <div class="entry-content"> <p><?php _e( 'Apologies, but no results were found for the requested archive. Perhaps searching will help find a related post.', 'hct' ); ?></p> <?php get_search_form(); ?> </div><!-- .entry-content --> </article><!-- #post-0 --> <?php endif; ?> </div><!-- #content -->
CONTENT.PHP LOOP (CALLED BY INDEX.PHP)
<?php $count = $wp_query->current_post; $c = fmod($count,3); if ($c == '2') : ?> <div style="clear:both;"></div> <?php endif;?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Adsense between a grid loop of posts?’ is closed to new replies.