Forums

Category Count is displaying below the Category (3 posts)

  1. mikecicc
    Member
    Posted 4 years ago #

    http://www.buffaroll.com

    here is my syntax:
    <?php wp_list_categories('show_count=1&hierarchical=0&title_li=0') ?>

    if i remove the
    show_count=1&

    the categories display fine, I'de like for the count to be displayed next to the category note below it..

    Thanks in advance !

  2. Jimi Wikman
    Member
    Posted 3 years ago #

    Its likely because you have styled the link of the category as block which then makes the count drop below since its added outside the url.

  3. The category name(count)

    The display:block takes whats inside the a tag and make it a block element and since the count is located outside that block it drops below instead. Annoying and I am not sure where in teh code to fix that.

  • Jimi Wikman
    Member
    Posted 3 years ago #

    Found a way to solve this, if you have the same problem as I described above :)

    in classes.php find

    $link .= $cat_name . '</a>';

    replace that with:

    $link .= $cat_name . ' (' . intval($category->count) . ')</a>';

    This will make the count show up inside the a tag. You still get the count on a second row though, so we need to remove the original code. Find:

    if ( isset($show_count) && $show_count )
    			$link .= ' (' . intval($category->count) . ')';

    and simply remove it.

    Now things should work for you (fingers crossed)

  • Topic Closed

    This topic has been closed to new replies.

    About this Topic

    Tags