The following snippet will let you display an advert after the first post in WordPress.
1 2 3 4 5 6 7 | <?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); $loopcounter++; ?> // the loop stuffs <?php if ($loopcounter <= 1) { include (TEMPLATEPATH . '/ad.php'); } ?> <?php endwhile; ?> <?php else : ?> <?php endif; ?> |
Snippet Source/Credit: WPLift