WordPress.org

Ready to get started?Download WordPress

Forums

Listening # Of Posts In Catagories List (3 posts)

  1. Nudger
    Member
    Posted 6 years ago #

    On my blog here, I'm using a theme that doesn't use widgets but displays my catagories on the sidebar.

    I want to have the number of posts from each catagory displayed next to the catagory like this

    * Gap Year (6 Posts)
    o Junten (6 Posts)
    o Partying (7 Posts)
    o Tokyo (19 Posts)

    Ect. How can I do this? The code from the sidebar is this;

    <h3><?php _e('Categories'); ?></h3>
    				<ul>
    					<?php wp_list_cats(); ?>
    				</ul>
    		<div class="line"></div>

    Any ideas?

  2. Nudger
    Member
    Posted 6 years ago #

    BUMP

  3. Jeremy Clark
    Moderator
    Posted 6 years ago #

    First off wp_list_cats is deprecated and you'll need to replace it with the newer wp_list_categories.

    To show the post count next to the category use this code
    <?php wp_list_categories('show_count=1'); ?>

    Resource:
    http://codex.wordpress.org/Template_Tags/wp_list_categories#Parameters

Topic Closed

This topic has been closed to new replies.

About this Topic