Title: sysbuilder's Replies | WordPress.org

---

# sysbuilder

  [  ](https://wordpress.org/support/users/sysbuilder/)

 *   [Profile](https://wordpress.org/support/users/sysbuilder/)
 *   [Topics Started](https://wordpress.org/support/users/sysbuilder/topics/)
 *   [Replies Created](https://wordpress.org/support/users/sysbuilder/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/sysbuilder/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/sysbuilder/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/sysbuilder/engagements/)
 *   [Favorites](https://wordpress.org/support/users/sysbuilder/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
   
   In reply to: [How to show posts from same category as current post in sidebar?](https://wordpress.org/support/topic/how-to-show-posts-from-same-category-as-current-post-in-sidebar/)
 *  Thread Starter [sysbuilder](https://wordpress.org/support/users/sysbuilder/)
 * (@sysbuilder)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/how-to-show-posts-from-same-category-as-current-post-in-sidebar/#post-1036701)
 * Awesome.. tweaked the code a bit and it works great.
 * One more question – I tried adding the_excerpt() so it looked like this (as I’d
   like to have a short excerpt of each entry that gets displayed in the sidebar):
 *  `<?php
    global $post; $categories = get_the_category(); foreach ($categories
   as $category) : ?> <h2><?php echo $category->name; ?></h2> <?php $posts = get_posts(‘
   numberposts=20&category=’. $category->term_id); foreach($posts as $post) : ?>
   <?php the_title(); ?> <?php the_excerpt(); ?> <?php endforeach; ?> <?php endforeach;?
   >`
 * When I do that, the same excerpt gets shown for all of the entries, although 
   the entry titles change.
 * Any idea of what I might be doing wrong?

Viewing 1 replies (of 1 total)