WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Can't figure out how to add Post Count to Categories in Sidebar (9 posts)

  1. drursi08
    Member
    Posted 8 years ago #

    Hi all,

    Ive searched for a couple hours and tried several options and havent gotten anything to work.

    I'm trying to add a post count to my categories on my sidebar here: http://www.sevenstripes.com/blog

    In my sidebar, the categories code is as follows:
    <?php wp_list_cats(0, 'All', 'name', 'asc', '', 0, 1, 1, 1, 1, 1, 0,'','','','','') ?>

    Ive used the following page as a reference but with no success:
    http://codex.wordpress.org/Template_Tags/wp_list_cats

    Can anyone assist me please?

  2. BPartch
    Member
    Posted 8 years ago #

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

  3. drursi08
    Member
    Posted 8 years ago #

    That did the trick, but it seemed to have bumped my categories down like so:

    http://sevenstripes.com/blog/

    any ideas on how to put the Post Count right next to the Category?

  4. drursi08
    Member
    Posted 8 years ago #

    Bump!

  5. drursi08
    Member
    Posted 8 years ago #

    I changed the code back so my Categories didnt look gaffed up on my website. But, it looked like this:

    Domestic Politics (U.S.)
    (7)
    Europe
    (2)
    Islamic Extremism
    (8)

    Instead of this, what I want:

    Domestic Politics (U.S.) (7)
    Europe (2)
    Islamic Extremism (8)

  6. BPartch
    Member
    Posted 8 years ago #

    Hello

    Hmmm, not sure, I copied the code from your site to my hard drive and added numbers such as...(237) to the end of the category links, and it looks ok to me.

  7. drursi08
    Member
    Posted 8 years ago #

    I don't want to add the numbers to the end of the category links... I want the number of posts in that category to be automatically displayed next to the category as shown above, instead of underneath, as also shown above.

  8. moshu
    Member
    Posted 8 years ago #

    This question has been answered several times...
    See if this info helps: http://wordpress.org/support/topic/51030?replies=7

  9. BPartch
    Member
    Posted 8 years ago #

    Hello

    I don't want to add the numbers to the end of the category links... I want the number of posts in that category to be automatically displayed next to the category as shown above, instead of underneath, as also shown above.

    Either the numbers are added by hand or dynamically, they still take up the same amount of space, once they are there.

Topic Closed

This topic has been closed to new replies.

About this Topic