Title: Can&#039;t close Loop
Last modified: August 19, 2016

---

# Can't close Loop

 *  [at0mickarma](https://wordpress.org/support/users/at0mickarma/)
 * (@at0mickarma)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/cant-close-loop/)
 * Hi
 * I’m using the following code in my sidebar:
 *     ```
       <ul>
       <?php query_posts('category_name=obituaries&showposts=5'); ?>
       <?php while (have_posts()) : the_post(); ?>
               <li><a href="<?php the_permalink(); ?>">
                 <?php the_title(); ?>
                 </a>  </li>
               <?php endwhile; ?>
   
       </ul>
       ```
   
 * in order to show a list from the specifed category.
 * However I’m also trying to display a breadcrumb trail on my index.php, using
 *     ```
       <?php
         $curr_cat = single_cat_title('', false); echo $curr_cat;?>
       ```
   
 * But this will only display the category stated in the sidebar. If I change the
   cat in the sidebar, the breadcrumb changes.
 * it’s as if the loop in the sidebar isn’t closing, and I cannot work out how to
   stop this from happening. Any help on this gratefully received!

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [at0mickarma](https://wordpress.org/support/users/at0mickarma/)
 * (@at0mickarma)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/cant-close-loop/#post-1603729)
 * If no one has an answer to this, is there perhaps a decent breadcrumb plugin 
   I could use that anyone can recommend?
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/cant-close-loop/#post-1603732)
 * try to add `wp_reset_query();` after your loop;
 * [http://codex.wordpress.org/Function_Reference/wp_reset_query](http://codex.wordpress.org/Function_Reference/wp_reset_query)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Can't close Loop’ is closed to new replies.

## Tags

 * [categories](https://wordpress.org/support/topic-tag/categories/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 2 participants
 * Last reply from: [Michael](https://wordpress.org/support/users/alchymyth/)
 * Last activity: [15 years, 8 months ago](https://wordpress.org/support/topic/cant-close-loop/#post-1603732)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
