WordPress.org

Ready to get started?Download WordPress

Forums

wp_list_cats and optioncount - simple question (5 posts)

  1. snowcrash
    Member
    Posted 8 years ago #

    Hello

    I'm trying to modify the blix theme, so for categories, it displays the number of articles

    e.g.
    uncategorized (10)
    politics (5)

    I'm a php/css noob, but I gather that

    <?php wp_list_cats('sort_column=name&hide_empty=0); ?>

    should be modified to:

    <?php wp_list_cats('sort_column=name&hide_empty=0&optioncount=1'); ?>

    But when I do this, the display is not formatted properly as such:
    uncategorized
    (10)
    politics
    (5)

    Is this a css thing? Any help would be appreciated

    thanks

  2. Kafkaesqui

    Posted 8 years ago #

    "Is this a css thing?"

    That's exactly what it is. In Blix's layout.css, locate:

    #subcontent li a {
    display:block;
    padding:1px 0;
    height:1%; /* IE WIN */
    }

    If you remove display: block; I believe this will keep post count from being bumped to the next line.

  3. snowcrash
    Member
    Posted 8 years ago #

    Kafkaesqui, that's great - worked just like you said

    many thanks

  4. cyandrea
    Member
    Posted 7 years ago #

    Hi, I have the same problem, but I need a display:block for my <a>. Which file I have to modify in order to include the optioncount inside the tag </a>?

    thank you!

  5. cyandrea
    Member
    Posted 7 years ago #

    anyone can help me?!

Topic Closed

This topic has been closed to new replies.

About this Topic