• rankbeginner

    (@rankbeginner)


    Hello again,

    My categories are being sorted by ID, instead of alphabetically by name. I just searched the Forum archives and learned that ID is the default, and to sort categories by name, the ‘name’ value must be entered.

    So I looked at my sidebar.php file, and found this — which looks to me like the ‘name’ value is in there. But the categroies are not sorting right:

    • <h2><?php _e(‘Categories’); ?></h2>

      <?php list_cats(0, ”, ‘name’, ‘asc’, ”, 1, 0, 1, 1, 1, 1, 0,”,”,”,”,”) ?>

    Suggestions. Thanks again … RB

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

    (@moshu)

    2 suggestions:
    1. always put your code in backticks – see the text below the text area here
    2. read the Codex http://codex.wordpress.org/Template_Tags/list_cats

    emmadw

    (@emmadw)

    I’ve just found an answer to this … if you have a look at this thread , you’ll see that there is an updated file that you can download, which will get rid of that frustration. I’ve just spent quite a bit of time, as I suspect you have, re-reading that line over and over again, wondering if I really had spelled name right etc.

    Luckily for us, it wasn’t us, it was the software 🙂

    c0y0te

    (@c0y0te)

    Hi there,

    I had the same issue and resolved it, and as a result put up a tutorial on ‘how’ to do it at my blog site. Check out
    http://www.avalon5.com/index.php/archives/41

    I’m confident it will solve your problem. Any questions – leave me a comment or contact me here, or at avalon5.com.

    c0y0te

    Thread Starter rankbeginner

    (@rankbeginner)

    Problem solved.

    First, I learned what the “backtick” character is:
    “The backtick character is usually located with the ~ character on the upper or lower left-hand side of the keyboard.”

    For the main problem, of the good suggestions offered above, I did the simplest for me: update my file template-functions-category.php, which was located in the folder: wp-includes

    Now the categories sort alphabetically. Life is good.

    Thanks, everyone! … RB

    emmadw

    (@emmadw)

    If you’ve got a UK keyboard, then it’s not associated with the ~ character (which is, for us, a shifted # – just next to enter), but it is the upper left key.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Categories — Sorting by Name’ is closed to new replies.