WordPress.org

Ready to get started?Download WordPress

Forums

php list_cat problem (6 posts)

  1. sskhalsa
    Member
    Posted 9 years ago #

    on my sidebar i am using the following code for the category list:

    <?php list_cats(1, 'All', 'name', 'asc', '',1,0,1,1); ?>

    I think its right; all I really want to do is have my category list show the number of posts in each category. I have gotten the # of posts to show up, but they come on a second line beneath the category. Any fixes?

    go to http://www.sskhalsa.com if u wanna see the problem in action

  2. Lorelle
    Member
    Posted 9 years ago #

    Try this, if all you want is the show the number of posts:

    <ul>
    <?php wp_list_cats('optioncount=1'); ?>
    </ul>

    And if they show up on the next line, consider making your sidebar wider or whatever wider that is causing your lines to wrap. There is no code to force the line break. Something is too narrow there.

    http://codex.wordpress.org/Template_Tags/wp_list_cats
    http://codex.wordpress.org/Template_Tags/list_cats

  3. Joshua Sigar
    Member
    Posted 9 years ago #

    Actually, it's more of CSS issue.

    In your CSS file, you have the following.
    #sidebar ul li ul li a{
    display: block;
    height:1%; /* IE WIN */
    }

    If you delete the display: block; you should have the category name and category count on the same line.

  4. sskhalsa
    Member
    Posted 9 years ago #

    yo

    you guysss areee crazzzy lol

    thanks alot man alphaoide...it worked perfect

    mad pimp support here

  5. imperialman
    Member
    Posted 8 years ago #

    Deleting display: block; only fixed this problem in Firefox for me -- but not Internet Explorer. Does anyone know why IE would look different?

    It looks pretty shoddy to have the post count on the second line... See http://www.baerguide.com. Any help would be appreciated!

  6. Kafkaesqui

    Posted 8 years ago #

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags