• Resolved laplix

    (@laplix)


    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.

Viewing 10 replies - 1 through 10 (of 10 total)
  • 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

    Thread Starter laplix

    (@laplix)

    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?

    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.

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

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

    Thread Starter laplix

    (@laplix)

    @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?

    Thread Starter laplix

    (@laplix)

    @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

    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:
    https://www.ads-software.com/extend/plugins/my-category-order/

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

    Thread Starter laplix

    (@laplix)

    @handysolo

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

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

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘I need help on ordering categories in the sidebar’ is closed to new replies.