WordPress.org

Ready to get started?Download WordPress

Forums

Sorting categories by name using <?php wp_list_cats('arguments'); ?> (7 posts)

  1. Daisyhead
    Member
    Posted 8 years ago #

    I am using the following template to list my categories on my archive page:

    <?php wp_list_cats('arguments'); ?>

    The problem is, I can't get the categories to sort by alphabetical order, no matter what I do.

    Can anyone offer any suggestions??

  2. Daisyhead
    Member
    Posted 8 years ago #

    Btw, this is my current tag:

    <?php wp_list_cats('sort_order=1&optioncount=1&exclude=0&list=0&sort_column=name'); ?>

    I still cannot get the Category archive list to sort alphabetically.

    Any help would be greatly appreciated!

  3. Beel
    Member
    Posted 8 years ago #

    If sort_order=name does not work, upgrade to current version

  4. Kafkaesqui

    Posted 8 years ago #

    Follow Beel's advice. You've run into a bug in (wp_)list_cats.

  5. JacksonBoyle
    Member
    Posted 8 years ago #

    I use this :

    '<?php list_cats(FALSE, ' ', 'name'); ?>'

    Works OK for me.

  6. Beel
    Member
    Posted 8 years ago #

    You removed the "leave this for stats" line for WP but I am willing to bet you have the latest version. Bet if you downgrade it won't work OK ;-)

  7. magcut
    Member
    Posted 8 years ago #

    Thanks Boyle. I just spent the afternoon trying every other hack there is. <?php list_cats(FALSE, ' ', 'name'); ?> is the winning ticket for 5.1.2.

Topic Closed

This topic has been closed to new replies.

About this Topic