WordPress.org

Ready to get started?Download WordPress

Forums

Sorting posts alphabetically (4 posts)

  1. tcervo
    Member
    Posted 10 years ago #

    Sorry if this is obvious, but I can't seem to find the answer (then again, I'm a bit under the weather so it's no surprise...)
    How can I get the posts on a category page to display alphabetically by default, instead of by date?
    Thanks in advance,
    Tony

  2. tcervo
    Member
    Posted 10 years ago #

    *bump*

  3. tcervo
    Member
    Posted 10 years ago #

    Problem solved, but in a roundabout way:
    (This also solved my cats as headings, sub-cats as links issue - http://wordpress.org/support/10/2373)
    I'm not displaying my categories at all. Instead, I simply set up a link category to match each category. Then, I create a link for each sub-category and assign it to the proper link cateogory. The uri of the link will include the category id and sort information.
    For example, if I have a sub-category of "Italian" in the category of "Region", I create the following link:
    Name: Italian
    URI: /index.php?cat=33&orderby=title&order=ASC
    Cateogry: Region
    Then, I simply use get_links_list() in place of list_cats(), and I've killed two birds with one stone! Since I'm not using any outside links at this point, get_links_list() will work just fine. If I decide later to add links, it'll simply be a matter of building my fake "category" section using get_linksbyname, then building the "links" section somewhere else using the same method.
    Wish there was another way, but I'll take it.
    -Tony

  4. limpy_jim
    Member
    Posted 10 years ago #

    Hi Tony,
    I like this way of ordering my categories, and have a question: is there a way of placing the number of posts in each category by placing them this way?

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.