Posted By

mrwolfgraphics on 12/22/10


Tagged


Versions (?)

Display an Advert after the first Post in Wordpress


 / Published in: PHP
 

URL: http://wplift.com/22-handy-wordpress-code-snippets

  1. <?php if (have_posts()) : ?>
  2.  
  3. <?php while (have_posts()) : the_post(); $loopcounter++; ?>
  4.  
  5. // the loop stuffs
  6.  
  7. <?php if ($loopcounter <= 1) { include (TEMPLATEPATH . '/ad.php'); } ?>
  8.  
  9. <?php endwhile; ?>
  10.  
  11. <?php else : ?>
  12.  
  13. <?php endif; ?>

Report this snippet  

You need to login to post a comment.