Forums

[resolved] I need help on ordering categories in the sidebar (11 posts)

  1. laplix
    Member
    Posted 3 years ago #

    Hi all,

    I'm trying to move a static site to WordPress. I have a problem on ordering categories. I have a main category called "editorials" which has two sub-categories, "from our president" and "from our director"

    Contrary to pages, WP doesn't seem to allow us to order categories manually. Since (D)irector comes before (P)resident when you sort on names, that's what I get in my menu. Problem is, I want president before director. Right now, I could use a DESC sorting order but later, we will have other people doing editorials and each one will have its own category so sorting on category names won't work.

    Any idea would be appreciated.

  2. Chris_K
    Member
    Posted 3 years ago #

    is your theme using wp_list_categories for display? It supports some order options. Maybe you can get something going there that would work?

    orderby
    (string) Sort categories alphabetically, by unique Category ID, or by the count of posts in that Category. The default is sort by category name. Valid values:

    * ID
    * name - default
    * count

    order
    (string) Sort order for categories (either ascending or descending). The default is ascending. Valid values:

    * ASC - default
    * DESC

  3. laplix
    Member
    Posted 3 years ago #

    Thank you HandySolo for your answer but this won't work. As I said in my post, I can't use the normal sorting system.

    For instance, right now I have

    • editorials
      • from our director
      • from our president

    I could reverse the sorting order and it would work for now. I want the president to be first, the director second.

    But I expect that other members of the board of directors will want to express their opinion and their category could be their title or name. But I still want that part of my menu to start with the president and the director. What I want is something like this

    • editorials
      • from our president
      • from our director¸
      • from Alain Dion
      • from Louis Lapointe

    Now, in ASC sorting order, I would get

    • editorials
      • from Alain Dion
      • from Louis Lapointe
      • from our director¸
      • from our president

    In fact, what I need is to be able to decide manually the sorting order. Is this possible?

  4. iridiax
    Member
    Posted 3 years ago #

    In fact, what I need is to be able to decide manually the sorting order. Is this possible?

    Yes, you can create the category links as regular, static html links.

  5. Chris_K
    Member
    Posted 3 years ago #

    Yes, you can create the category links as regular, static html links.

    Yep. That's probably your best answer for your situation.

  6. laplix
    Member
    Posted 3 years ago #

    @iridiax

    Ok. This means I can't use the wp_list_categories() function right?

    Which also means that I would have to edit the sidebar.php file when somebody is added?

    No other "automatic" way?

  7. laplix
    Member
    Posted 3 years ago #

    @WordPress_Community

    I sent this post less than an hour ago and already had two generous persons responding. This gives me a *very* warm feeling.

    I wish to thank all the people working on WP and all the people helping us out (we noobies). You are really very generous of your time and brain power.

    Thank you again. I'll try to play my part as soon as I am on par with WP.

    Louis

  8. Chris_K
    Member
    Posted 3 years ago #

    Glad we could at least "kind of" help you :-)

    You might also search for a plugin. I have a vague recollection of seeing a WP plugin that would do some other sorts of ordering on category lists. It may have been this one:
    http://wordpress.org/extend/plugins/my-category-order/

  9. Ryan Paul
    Member
    Posted 3 years ago #

    I use that plugin, and it works PERFECTLY. So do the my-page-order plugin.

  10. laplix
    Member
    Posted 3 years ago #

    @HandySolo

    Thank you very much. It works perfectly. Exactly what I needed.

  11. mores
    Member
    Posted 3 years ago #

    Thank you for this post, and thank you for the reply, hansolo. It helped me a lot!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.