Title: greenwhy's Replies | WordPress.org

---

# greenwhy

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

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

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Themes and Templates](https://wordpress.org/support/forum/themes-and-templates/)
   
   In reply to: [How to exclude single_cat_title() from get_the_category() ?](https://wordpress.org/support/topic/how-to-exclude-single_cat_title-from-get_the_category/)
 *  Thread Starter [greenwhy](https://wordpress.org/support/users/greenwhy/)
 * (@greenwhy)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/how-to-exclude-single_cat_title-from-get_the_category/#post-5644101)
 * **SOLVED**
 *     ```
       $category = get_category( get_query_var( 'cat' ) );
       $cat_id = $category->cat_ID;
       foreach((get_the_category()) as $cat) {
       if (!($cat->cat_ID==$cat_id)) echo '<a href="' . get_bloginfo('url') . '/category/' . $cat->category_nicename . '/">'. $cat->cat_name . '</a>' . ', ';
       }
       ```
   

Viewing 1 replies (of 1 total)