• tri-fusion

    (@tri-fusion)


    I want to show how many posts in that category and here’s the code without showing number of posts. Does anyone know how to do it?

    <?php wp_list_cats(‘sort_column=id&hide_empty=0&optioncount=0&hierarchical=1’); ?>

    thanks

Viewing 15 replies - 1 through 15 (of 17 total)
  • Chris_K

    (@handysolo)

    change optioncount=0 to optioncount=1 and see if that does it.

    wp_list_cats documentation: https://codex.www.ads-software.com/Template_Tags/wp_list_cats

    Thread Starter tri-fusion

    (@tri-fusion)

    Thanks for your quick reply

    it doesn’t work HandySolo neither the link you gave ??

    Chris_K

    (@handysolo)

    From the link (which is now working. unfortunately, I can’t control when the codex goes down)

    optioncount
    (boolean) Sets whether to display a count of posts in each Category. Valid values:

    * 1 (True)
    * 0 (False – default)

    A) Make sure you’re changing the sidebar in your current theme.

    B) If you’re running wp-cache, visit options -> wp-cache and click the clear cache button.

    Thread Starter tri-fusion

    (@tri-fusion)

    I believe I don’t have wp-cache. Is it a separate plugin?

    Note: I’ve just installed latest version.

    Thread Starter tri-fusion

    (@tri-fusion)

    advanced-cache.php link does not exist
    Create it by executing:
    ln -s /home/site/public_html/wp-content/plugins/wp-cache/wp-cache-phase1.php /home/site/public_html/wp-content/advanced-cache.php
    in your server

    Cannot continue… fix previous problems and retry.

    Do you know how to run this string on reseller server?

    Chris_K

    (@handysolo)

    Err, if you weren’t currently running wp-cache, you don’t need it to show category counts!

    I threw that section in just in case you might be.

    What version of WP are you using?

    Thread Starter tri-fusion

    (@tri-fusion)

    2.0.5

    Chris_K

    (@handysolo)

    Show me your current wp_list_cats call with arguments please.

    Thread Starter tri-fusion

    (@tri-fusion)

    <?php wp_list_cats(‘sort_column=id&hide_empty=0&optioncount=0&hierarchical=1’); ?>

    Chris_K

    (@handysolo)

    Well…

    So let’s go back to my first reply to you:

    change optioncount=0 to optioncount=1 and see if that does it.

    It’s right in the middle of that string you just shared with me. Change 0 to 1.

    Thread Starter tri-fusion

    (@tri-fusion)

    I already did change the value but it didn’t work. Oh well, that’s okay.

    Thanks a lot handysolo

    Chris_K

    (@handysolo)

    If you changed it, why don’t I see it in what you just pasted 3 replies back?

    You gave me:
    <?php wp_list_cats('sort_column=id&hide_empty=0&optioncount=0&hierarchical=1'); ?>

    I’m trying to tell you that you want:
    <?php wp_list_cats('sort_column=id&hide_empty=0&optioncount=1&hierarchical=1'); ?>

    I’m having the same problem.

    In my Sidebar Widgets window, I’m using the default “Categories” and there are no numbers after the category names.

    Any help is appreciated.

    Brooks

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    All these methods you mentioned above are deprecated in the newest wordpress version, now where do I find those, plz?

Viewing 15 replies - 1 through 15 (of 17 total)
  • The topic ‘Show number of post next to category name’ is closed to new replies.