Display an Advert after the first Post in Wordpress


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  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; ?>

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

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.