Title: Display Active Viewed Category
Last modified: August 18, 2016

---

# Display Active Viewed Category

 *  [adapting](https://wordpress.org/support/users/adapting/)
 * (@adapting)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/display-active-viewed-category/)
 * The theme K2 can display a list of pages and separate the active viewed page 
   from the rest. Check out what I mean at [http://getk2.com/](http://getk2.com)
 * This is done by using the following code:
 *     ```
       <ul class="menu">
       			<?php if ('page' != get_option('show_on_front')) { ?>
       			<li class="<?php if ( is_home() or is_archive() or is_single() or is_paged() or is_search() or (function_exists('is_tag') and is_tag()) ) { ?>current_page_item<?php } else { ?>page_item<?php } ?>"><a href="<?php echo get_settings('home'); ?>/" title="<?php echo get_option('k2blogornoblog'); ?>"><?php echo get_option('k2blogornoblog'); ?></a></li>
       			<?php } ?>
       			<?php wp_list_pages('sort_column=menu_order&depth=1&title_li='); ?>
       			<?php wp_register('<li class="admintab">','</li>'); ?>
       		</ul>
       ```
   
 * It seems the key line is `<?php wp_list_pages('sort_column=menu_order&depth=1&
   title_li='); ?>`
 * Instead of listing pages. I want to list categories. I have check out [wp_list_cats()](http://codex.wordpress.org/Template_Tags/wp_list_cats)
   which says the php should be `wp_list_categories` but I cannot get it working.
 * By working I mean to display a simple list like on K2 but instead of pages being
   displayed, categories will be displayed and the active category will be separated
   from the rest …
 * How do I do this?
 * Thanks
 * Alan

Viewing 1 replies (of 1 total)

 *  [Andrew Ozz](https://wordpress.org/support/users/azaozz/)
 * (@azaozz)
 * [19 years, 1 month ago](https://wordpress.org/support/topic/display-active-viewed-category/#post-549136)
 * If you are running WP 2.1, check [http://codex.wordpress.org/Template_Tags/wp_list_categories](http://codex.wordpress.org/Template_Tags/wp_list_categories)
   for the right arguments.

Viewing 1 replies (of 1 total)

The topic ‘Display Active Viewed Category’ is closed to new replies.

## Tags

 * [active](https://wordpress.org/support/topic-tag/active/)
 * [list_categories](https://wordpress.org/support/topic-tag/list_categories/)
 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [Andrew Ozz](https://wordpress.org/support/users/azaozz/)
 * Last activity: [19 years, 1 month ago](https://wordpress.org/support/topic/display-active-viewed-category/#post-549136)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
