Insert custom content inside the loop

<?php if (have_posts()) : 
$count = 0;
while (have_posts()) : the_post();
$count++;
if ($count == 2) : ?>
          //Paste your custom content code here
          <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
          <?php the_excerpt(); ?>
   <?php else : ?>
          <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
          <?php the_excerpt(); endif; endwhile; endif; ?>

Leave a comment