Forums

How do you enable the number of posts in a category to show up on the sidebar? (7 posts)

  1. thehalogod
    Member
    Posted 4 years ago #

    How do you enable the number of posts in a category to show up on the sidebar?

    I'm using this theme:

    http://wpthemes.info/shaded-grey

    And want to be able to show the number of posts that are in a particular category for my blog. Let me know if you can do this.

  2. miromiro
    Member
    Posted 4 years ago #

    List categories:

    'show_count' => 1,

  3. thehalogod
    Member
    Posted 4 years ago #

    Where do I put that in the sidebar though?

  4. miromiro
    Member
    Posted 4 years ago #

    It will say something like (depending on your theme - I am not familiar with shaded-grey):

    <h2>Categories</h2>
    <?php wp_list_categories('show_count' => 1'); ?>
    </li>

    Just search on 'list_categories'...

  5. thehalogod
    Member
    Posted 4 years ago #

    <?php wp_list_cats('optioncount=1'); ?>

    I had the above. When I replaced that with:

    <?php wp_list_categories('show_count' => 1'); ?>

    I got a parse error and the sidebar wouldn't display. I also tried:

    <?php wp_list_cats('show_count' => 1'); ?>

    But that didn't work either. What am I missing?

  6. actorjiml
    Member
    Posted 4 years ago #

    Change that to:
    <?php wp_list_categories('show_count=1'); ?>

    You can see what else can be done with wp_list_categories(); here.

  7. moshu
    Member
    Posted 4 years ago #

    actorjiml is right - reading the documentation about the parameters is a great way to spare time :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.