WordPress.org

Ready to get started?Download WordPress

Forums

add post count to wp_dropdown_cats? (8 posts)

  1. jhorner
    Member
    Posted 10 years ago #

    Anyone know how I can add a count of posts in each of the categories listed by wp_dropdown_cats? Thanks!

  2. codergurl
    Member
    Posted 10 years ago #

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

  3. bAs
    Member
    Posted 10 years ago #

    <?php dropdown_cats('1','All','name','asc','0','1','1'); ?>
    works for me. see the template tags docs.

  4. codergurl
    Member
    Posted 10 years ago #

    *bangs head against desk*
    I got myself confuzzled. There is no wp_dropdown_cats() function! o_O

  5. Anonymous
    Unregistered
    Posted 10 years ago #

    The problem with dropdown_cats is that it does not respect the subcategories in the dropdown list. wp_dropdown_cats sorts the list correctly but does not seem to have a command for listing the post count. Anyone have other ideas for how to do this?

  6. Anonymous
    Unregistered
    Posted 10 years ago #

    There's a reference to this same problem here with a partial solution:
    [code]
    <li id="categories">Categories:

      <?php list_cats(0, 'All', 'name', 'asc', '',1,0,1,1); ?>
  7. [/code]
    But, again the heiarchy structure is sadly missing.

  • jhorner
    Member
    Posted 10 years ago #

    I value to hierarchy over the post count - since it appears there is no way to have both. Anyone?

  • sakamuyo
    Member
    Posted 10 years ago #

    Re-engineer the dropdown_cats code to do what you want it to. :)

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags

    No tags yet.