• Im wanting to be able to call a single category and display the post count within that cat next to it. Just like the normal category widget can do, but I want to choose which are displayed and I want to call each one specifically.
    Anyone know how, or even what Im rambling about?

Viewing 5 replies - 1 through 5 (of 5 total)
  • Where?

    Thread Starter Twig

    (@twig)

    I want to call it in a normal text widget.

    You can’t. The templatetags are PHP code and that’s not executed in text widgets.
    You will need a PHP widget. Search.
    And then you will need to read about the category template tags: http://codex.wordpress.org/Template_Tags#Category_tags

    Thread Starter Twig

    (@twig)

    Ive been reading the Category tags page, and I cant really figure out how to call a specific cat with its post count.

    <ul>
    <?php
    wp_list_categories('orderby=name&include=3,5,9,16'); ?>
    </ul>

    I get that you use that to display the cats, but would the code be:

    <ul>
    <?php
    wp_list_categories('orderby=name&include=3,5,9,16', 'show_count' => 0); ?>
    </ul>

    orrr…

    <ul>
    <?php
    wp_list_categories('orderby=name&include=3,5,9,16'), 'show_count' => 0; ?>
    </ul>

    or maybe Im wrong in both?

    Thread Starter Twig

    (@twig)

    WOW. I feel really stupid now. The whole reason it wasnt working…. there was a space in the code.

    <ul>
    <?php
    wp_list_categories('orderby=name&show_count=1&include=1,5,7'); ?>
    </ul>

    I knew this was right… and it pissed me off that it didnt work. When it wrapped onto the next line in the text box there was also a space. Anyhow, theres the actual code in case anyone in the future has this question.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘List specific category with post count?’ is closed to new replies.