Ok this is what I actually have in my index. I can change the $showads to any number I want to indicate which post to show the Ads after. But, I want to show it after post 1 and after 2…
I can’t seem to find this anywhere.. ideas??
<?php
get_header();
?>
<?php $postnum = 1; $showads = 1; ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class=”post”>
<h3 class=”storytitle” id=”post-<?php the_ID(); ?>”><div id=docimage></div>” rel=”bookmark”><?php the_title(); ?></h3>
<div class=”meta”><?php _e(“Filed under”); ?> <?php the_category(‘,’) ?> <?php _e(‘by’)?> <?php the_author() ?> on <?php the_time(‘l F j, Y’); ?> <?php edit_post_link(__(‘Edit This’)); ?></div>
<div class=”storycontent”>
<?php the_content(__(‘(more…)’)); ?>
</div>
<div class=”feedback”>
<?php wp_link_pages(); ?>
“>Trackback · <?php comments_popup_link(__(‘No comments yet’), __(‘1 comment’), __(‘% comments’)); ?>
</div>
<?php trackback_rdf(); ?>
</div>
<?php comments_template(); // Get wp-comments.php template ?>
<?php if ($postnum == $showads) { ?> ADSENSE CODE HERE <?php } $postnum++; ?>
<?php endwhile; else: ?>
<?php _e(‘Sorry, no posts matched your criteria.’); ?>
<?php endif; ?>
<div class=”feedback”><?php posts_nav_link(‘ — ‘, __(‘« previous page’), __(‘next page »’)); ?></div>
<?php get_footer(); ?>
<br><br>