How to Sort WordPress Category

Discussion in 'WordPress' started by Minterest, Feb 28, 2007.

  1. #1
    I have selected all categories and sub categories for a sample post but the categories are sorted based on their name but not according the main category as in one of my another blog.

    As the catogy is listed like this it makes difficult for the users to navigate. I want the category names to be sorted based on their main category. For e.g Google AdSense and Google AdWords must appear under Google and so on.

    Is there anyway to do like that?

    Here is my URL http://www.world-wide-webmasters.com
     
    Minterest, Feb 28, 2007 IP
  2. jhmattern

    jhmattern Illustrious Member

    Messages:
    8,909
    Likes Received:
    794
    Best Answers:
    2
    Trophy Points:
    455
    #2
    Do you mean subcategories are showing up on the same level as main categories? If so, one of mine is doing the same thing (just depends on the theme I guess), so I'd love to know if someone knows how to fix that (although in all honesty it hadn't bothered me enough to actually look up a solution yet).
     
    jhmattern, Mar 1, 2007 IP
  3. dct

    dct Finder of cool gadgets

    Messages:
    3,132
    Likes Received:
    328
    Best Answers:
    0
    Trophy Points:
    230
    #3
    It depends on the theme, mine lists categories the way you're after and in sidebar.php the code is:
    <?php wp_list_cats('sort_column=name&optioncount=1'); ?>
    PHP:
     
    dct, Mar 1, 2007 IP
  4. Minterest

    Minterest Well-Known Member

    Messages:
    2,694
    Likes Received:
    39
    Best Answers:
    0
    Trophy Points:
    180
    #4
    I have checked my both blogs here is the code from the 2 sites

    From Problem Site

    <ul class="list-cat">
    <?php wp_list_cats('sort_column=name&optioncount=1&hierarchical=0'); ?>
    </ul>

    The Correct One

    <ul>

    <?php

    wp_list_cats('sort_column=name&hierarchical=0

    '); ?>

    </ul>
     
    Minterest, Mar 1, 2007 IP