WordPress.org

Support

Support » Installation » The Loop Itself

The Loop Itself

  • I’m working on installing the related posts plug in and the last step says:

    “Put <?php related_posts(); ?> somewhere in your WP loop.”

    This is a very dumb question, but I don’t exactly know what the loop is.

    Could you point me in the right direction?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Certainly. Here’s the documentation for it: The_Loop

    You’ll find it in your theme’s index.php. Many other theme files will likely have it as well (although, for that plugin, index.php and, if you have it, single.php are probably the two to focus on).

    here’s a snippit from one of my themes:

    <div class="entry">
    <?php the_content('<p class="serif">Read the rest of this entry &raquo;
    '); ?>
    </div>'
    <div>
    <hr />
    Possibly Related Posts:

      <?php related_posts(); ?>

    </div>`

    Thanks Handy. That helps a lot. However, now once I have put this into the Loop, I get a related posts link for my “about” page at the bottom of the page.

    I believe that this normallly appears on the side rail…

    can you provide some guidance as to how I might fix this issue?

    Thanks!

    Ah fun stuff.

    Apparently your theme uses index.php for Pages too.

    You’ll want to use Conditional_Tags in that case.

    Perhaps wrap the

    <div>
    <hr />
    Possibly Related Posts:
    <?php related_posts(); ?>
    </div>

    in a is_single() or a not is_page() would work?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘The Loop Itself’ is closed to new replies.
Skip to toolbar