Support » Plugins and Hacks » Related Posts – Ignore for First Post Only?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Something along the line of this?

    <?php
    $count = 0;
    if (have_posts()) {
     while (have_posts()) : the_post();
      $count++;
        if ($count <= 1) {
          the_content();
        } else {
          the_content();
          wp_related_posts();
        }
     endwhile;
    }
    ?>

    Thanks for the reply.

    Yeah, you got the related posts off the first post but it seems to be repeating every post on the homepage about 3 or 4 times, plus the related posts for the other posts are slightly messed up. I had a play with your code but it’s not fixed.

    <?php
    $count = 0;
    if (have_posts()) {
     while (have_posts()) : the_post();
      $count++;
        if ($count <= 1) {
          the_content();
        } else {
          echo '<div style="margin: 40px 0 0 0;"><h6>Related Items »</h6>';
          the_content();
          wp_related_posts();
          echo '</div>';
        }
     endwhile;
    }
    ?>

    This isn’t vital but if you have any simple ideas then let me know.

    Thanks again.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Related Posts – Ignore for First Post Only?’ is closed to new replies.