Support » Fixing WordPress » Categories in Alphabetical Order

  • I’m running WP 3.1.1 and a theme called Viroshop and want to show the categories in alphabetical order. see http://www.themountainbikeking.com and on the homepage the categories in the left handside need to be ordered.
    How can I make this happen?

    Thanks,

    Mark

Viewing 4 replies - 1 through 4 (of 4 total)
  • borantula

    (@borantula)

    see get_categories function

    if the list is prepared by using a custom query you can use orderby => name, order => ASC in args…

    but i guess its prepared using a plugin called collapsing categories…then you may need to change some settings in plugin files if there’s no option for ordering

    nice site btw..i like bikes

    Thanks for the feedback. Here’s the code I have:

    <div id=”sidebar”>

    <?php sidebarlogin(); ?>

    <?php if (is_user_logged_in()) : ?>
    <?php global $user_identity;get_currentuserinfo();?>
    <div class=”display-user”>
    <img src=”<?php bloginfo(‘template_directory’); ?>/images/user_silhouette.png”>
    <p>Hi, <?php echo $user_identity;?></p>
    </div>

    <?php else :?>
    <?php endif;?>

    <?php if (is_user_logged_in()) : ?>
    <div class=”wishlist”>
    <p>Wishlist Items</p>
    </div>
    <?php mfp_display(“order_by=post_title&remove_link=x”);?>

    <?php else :?>
    <?php endif;?>

    <?php echo “<ul class=’collapsCatList’>\n”;
    if (function_exists(‘collapsCat’)) {
    $blogcat = get_option( ‘viro_sidebar_exclude_cats’ );
    collapsCat(
    $defaults=array(
    ‘showPostCount’ => false,
    ‘inExclude’ => ‘exclude’,
    ‘inExcludeCats’ => $blogcat,
    ‘showPosts’ => false,
    ‘showPages’ => false,
    ‘linkToCat’ => false,
    ‘olderThan’ => 0,
    ‘excludeAll’ => ‘0’,
    ‘catSortOrder’ => ‘ASC’,
    ‘catSort’ => ‘catId’,
    ‘postSortOrder’ => ‘ASC’,
    ‘postSort’ => ‘postTitle’,
    ‘expand’ => ‘4’,
    ‘defaultExpand’ => ”,
    ‘postTitleLength’ => 0,
    ‘animate’ => true,
    ‘catfeed’ => ‘none’,
    ‘catTag’ => ‘cat’,
    ‘showPostDate’ => false,
    ‘postDateAppend’ => ‘after’,
    ‘postDateFormat’ => ‘m/d’,
    ‘useCookies’ => true,
    ‘showTopLevel’ => true,
    ‘postsBeforeCats’ => false,
    ‘debug’=>’0’
    )
    );
    } else {
    wp_get_categories(”);
    }
    echo “\n”;
    ?>

    <?php if (function_exists(‘dynamic_sidebar’) && dynamic_sidebar(‘widgetized-area’)) : else : ?>
    <?php endif; ?>

    </div>

    <!— Sidebar Ends –>

    This is a foreign language to me! What do I need to change?

    Regards,

    Mark

    borantula

    (@borantula)

    its the catSort option

    change 'catSort' => 'catId', to 'catSort' => 'catName',

    that will do the trick 😉

    Thanks a lot for this. Sorry for delay in responding. This was a great help.

    Regards,

    Mark

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Categories in Alphabetical Order’ is closed to new replies.