• In the wiki
    http://wiki.wordpress.org/index.php/TemplateTags#Categoryx20.tags
    (I can’t figuree out putting links in this thing)
    Anyways, in the wiki it says to use this code to show number of articles in category list:
    ‘<?php list_cats(option_all, ‘text’, ‘col’, ‘sort’, ‘file’, list, dates, count, hide_empty); ?>’
    After trying 4,000 different combinations of this (as is I get errors), I have to ask for helllllp.
    I tried ‘<?php list_cats( count); ?>’ and ten variation but no workie. I’m taking php but in the meantime how da heck do you get a list of categories with the number of posts in each one? I have category list, but can’t get numbers of posts to show.

Viewing 4 replies - 1 through 4 (of 4 total)
  • If you’re using 1.2, you can do this:
    <?php wp_list_cats('optioncount=1'); ?>

    Bruce, here’s the way I use list_cats in my own blog:
    <?php list_cats(1, ‘All’, ‘name’, ‘asc’, ”,1,0,1,1); ?>
    The 8th parameter, count shall be set to true, that is, “1”. You cannot ignore any other parameters, so, when you do not want a funcionality to work, set it to false (0).
    It should be enough to make things work fine. HTH.

    He is using 1.2 and I reported that optioncount was not working some time ago but it has been fixed. This function has changed since 1.0 so I suggest you look in template_functions_category to see what has been added/deleted. For those of us with short term memory it is easier to use:
    <?php wp_list_cats(‘optionall=1&sort_column=name&optioncount=1&feed=RSS Feed&feed_image=/wordpress/images/rss_small.gif’); ?> than to remember what, and in what order, to set in list_cats 😉

    optioncount=1 using 1.2 mingus counts draft entries too. :/

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Number of posts in cats’ is closed to new replies.