• hey2you

    (@hey2you)


    Hello,

    I want to print out the number of post by Categories and show it next to the corresponding Category. how can I do this??

    Thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • ivovic

    (@ivovic)

    if you’re trying to work with a wordpress template tag, your best bet is to find it in the Codex.

    In this case, one of the parameters for wp_list_categories() is ‘show_count’, which does exactly what you want.

    Check it out on that page.

    Thread Starter hey2you

    (@hey2you)

    Yes it works!! Thanks alot.

    But the number of post (x) is not next to the Category. It is under it, I think it apply an extra linefeed to it, how can I solve this??

    ivovic

    (@ivovic)

    it doesn’t apply a line feed or a line break, or anything at all.

    I can’t see your site, but… what might be happening, is that the extra (x) could be wrapping to the next line due to width…

    Or… your style sheet could have an interesting defintion for ‘cat-item’ or the links inside list-item tags.

    Thread Starter hey2you

    (@hey2you)

    my sidebar CSS code: Any thought??

    #sidebar ul, #topbar ul, #topbar li {
    margin: 0;
    padding:0;
    }

    #sidebar ul ol, #topbar ul ol {
    margin: 0;
    padding:0;
    }

    #sidebar ul li, #topbarleft ul li, #topbarcenter ul li {
    list-style-type:none;
    list-style-image:none;
    margin-bottom: 15px;
    padding-left:0px;
    }

    #sidebar ul p, #sidebar ul select, #topbar ul p {
    margin: 0px 0 0px;
    }

    #sidebar ul ul, #sidebar ul ol, #topbar ul ul, #topbar ul ol {
    margin: 5px 0 0 10px;
    }

    #sidebar ul ul ul, #sidebar ul ol, #topbar ul ul ul, #topbar ul ol {
    margin: 0 0 0 10px;
    }

    ol li, #sidebar ul ol li, #topbar ul ol li {
    list-style: decimal outside;
    }

    #sidebar ul ul li, #sidebar ul ol li, #topbar ul ul li, #topbar ul ol li {
    margin: 3px 0 0;
    padding: 0;
    }

    ivovic

    (@ivovic)

    no, but post a link to your site, please.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Display the number of post by Categories’ is closed to new replies.