Title: The Loop behavior &#8211; related posts
Last modified: August 19, 2016

---

# The Loop behavior – related posts

 *  [jpipitone](https://wordpress.org/support/users/jpipitone/)
 * (@jpipitone)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/the-loop-behavior-related-posts/)
 * Hey everyone,
 * I have been trying to tackle this one on my own for a few days, and I just can’t
   figure out what I’m doing wrong.
 * I have followed the instructions for the “Simple Tags” plugin, and I have ensured
   that the plug in is working, because it is posting related posts in each one 
   of my articles, however when I try to manually display related posts in the sidebar,
   it seems to be displaying all of the articles instead of just the articles with
   related tags.
 * Is there something wrong with my loop? Perhaps I am querying all of the articles,
   rather than something more specific to the related tags?
 * I’m at a loss, here’s the code:
 *     ```
       <h2>Related Articles</h2>
       	<?php if (function_exists('st_related_posts')): ?>
       		<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
       		<?php st_related_posts('number=10&amp;title=&amp;include_page=false&amp;except_wrap=35&amp;xformat=<a href="%permalink%" title="%title% (%date%)">%title%</a> <small>%post_excerpt%</small>'); ?>
       		<?php endwhile; ?>
       			<?php endif; ?>
       	<?php else: ?>
       		Missing Plugin: <a href="">Simple Tags</a>
       	<?php endif; ?>
       ```
   
 * Here’s the output:
 * RELATED ARTICLES
 * Park Avenue – Cafe Cibon New York (AP) – This is some dummy copy. You’re not 
   really supposed to read this dummy copy, it is just a place holder for people
   who need some type to visualize what the actual copy might look like if it were
   real content. If you want to read, I might suggest a good book, perhaps Hemingway
   or Melville. That’s […]
 * ———————————————————–
 * Band to keep your eye on New York (AP) – This is some dummy copy. You’re not 
   really supposed to read this dummy copy, it is just a place holder for people
   who need some type to visualize what the actual copy might look like if it were
   real content. If you want to read, I might suggest a good book, perhaps Hemingway
   or Melville. That’s […]
 * ———————————————————–
 * Band to keep your eye on New York (AP) – This is some dummy copy. You’re not 
   really supposed to read this dummy copy, it is just a place holder for people
   who need some type to visualize what the actual copy might look like if it were
   real content. If you want to read, I might suggest a good book, perhaps Hemingway
   or Melville. That’s […]
 * ———————————————————–
 * Welcome to Yourwebsite.com Yourwebsite.com is your resource for events, food 
   and dining, theater, music and arts. We are looking for contributors and editors
   who would love writing reviews and updating the local community of recent happenings
   and events.
 * ———————————————————–
 * Park Avenue – Cafe Cibon New York (AP) – This is some dummy copy. You’re not 
   really supposed to read this dummy copy, it is just a place holder for people
   who need some type to visualize what the actual copy might look like if it were
   real content. If you want to read, I might suggest a good book, perhaps Hemingway
   or Melville. That’s […]
 * ———————————————————–
 * Dubland Underground New York (AP) – This is some dummy copy. You’re not really
   supposed to read this dummy copy, it is just a place holder for people who need
   some type to visualize what the actual copy might look like if it were real content.
   If you want to read, I might suggest a good book, perhaps Hemingway or Melville.
   That’s […]
 * ———————————————————–
 * No related posts.
 * ———————————————————–
 * Welcome to Yourwebsite.com Yourwebsite.com is your resource for events, food 
   and dining, theater, music and arts. We are looking for contributors and editors
   who would love writing reviews and updating the local community of recent happenings
   and events.
 * ———————————————————–
 * Band to keep your eye on New York (AP) – This is some dummy copy. You’re not 
   really supposed to read this dummy copy, it is just a place holder for people
   who need some type to visualize what the actual copy might look like if it were
   real content. If you want to read, I might suggest a good book, perhaps Hemingway
   or Melville. That’s […]
 * ———————————————————–
 * No related posts.
 * ———————————————————–
 * No related posts.

The topic ‘The Loop behavior – related posts’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [jpipitone](https://wordpress.org/support/users/jpipitone/)
 * Last activity: [17 years, 1 month ago](https://wordpress.org/support/topic/the-loop-behavior-related-posts/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
