How to show the number of posts in each catagory in Wordpress 2.5.1??

Discussion in 'WordPress' started by life31, May 29, 2008.

  1. #1
    How to show the number of posts in each catagory in Wordpress 2.5.1

    This is really driving me nuts.

    Ok the normal wp_list_cats in wordpress 2.5.1 is like
    <?php wp_list_cats("sort_column=name&optioncount=0&hierarchical=0"); ?>

    So i tried editing it to wp_list_cats("sort_column=name&optioncount=1&hierarchical=1"); It does not work

    again I made it wp_list_cats("sort_column=name&show_count=1"); but even this does not work


    Why is it so. Why isant it working??

    How do I do that?? Please need help! This is driving me crazy.
     
    life31, May 29, 2008 IP
  2. UseShots

    UseShots Peon

    Messages:
    244
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #2
    This code works in my WP 2.5.1

    <?php wp_list_categories('show_count=1&title_li=<h2>Categories</h2>'); ?>
    PHP:
    You can see how it looks here: http://blog.useshots.com
     
    UseShots, May 29, 2008 IP
  3. UseShots

    UseShots Peon

    Messages:
    244
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #3
    BTW, wp_list_cats is depricated.

    http://codex.wordpress.org/Template_Tags/wp_list_cats
    "This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists."
     
    UseShots, May 29, 2008 IP
    life31 likes this.
  4. Mudra

    Mudra Peon

    Messages:
    173
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Thats the valuable information. Thanks friends
     
    Mudra, May 29, 2008 IP
  5. life31

    life31 Active Member

    Messages:
    1,024
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    78
    #5
    Thanks useshots

    Rep++

    Simple mistake due tolack of concentration :D :D The thing was I was using a cartagories widget there and trying to edit the original PHP file instead :D

    yes! While using any widget the original sidebar functions get suppresed :D
     
    life31, May 29, 2008 IP