WordPress.org

Forums

How to show post's category on single or category pages? (2 posts)

  1. MTV
    Member
    Posted 5 years ago #

    How can I show only post's category on single/category page and hide the rest of it?

    <ul id="menu">
    	<li<?php if(!is_category() && !is_page() && !is_single()) { ?> class="current-home"<?php } ?>><a href="<?php bloginfo('url'); ?>" title="Home"><?php print HOME; ?></a></li>
    	<li class="current-cat"><?php if(!is_home() && !is_page()) { ?><?php wp_list_categories('orderby=NAME&order=ASC&depth=1&hide_empty=1&title_li='); ?><?php } ?></li>
            <li class="current-page"><?php if(!is_home() && !is_single() && !is_category()) { ?><?php wp_list_pages('orderby=NAME&order=ASC&depth=1&title_li='); ?><?php } ?></li>
    </ul>
  2. Shane G
    Member
    Posted 5 years ago #

    Hi,

    Check with this plugin:

    http://wordpress.org/extend/plugins/category-posts/

    Thanks,

    Shane G.

Topic Closed

This topic has been closed to new replies.

About this Topic