WordPress.org

Forums

Change listing of child category order by id? (3 posts)

  1. snowcrash
    Member
    Posted 9 years ago #

    Hello

    I've set up a page which displays child categories using
    <?php wp_list_cats('sort_column=id&optioncount=0&use_desc_for_title=0&child_of=8'); ?>

    That is, I have a category called called Journal (with id=8), and its child categories as: Issue 1 (id=9), Issue 2 (id=10) etc.

    When the page is displayed, the child categories are ordered by their id:

    Issue 1
    Issue 2

    But can they be ordered in reverse, so the latest journal issue is listed at the top?:

    Issue 2
    Issue 1

    thanks in advance

  2. Chris_K
    Member
    Posted 9 years ago #

    Here's the documentation for wp_list_cats()
    http://codex.wordpress.org/Template_Tags/wp_list_cats

    Looks like there's a sort order in there.

  3. snowcrash
    Member
    Posted 9 years ago #

    Thanks for the quick reply.
    Yes, I did look at that.
    I've tried using 'sort_order', but it makes no difference.

    I'm uncertain whether it works on child categories?

    The child categories seem to be listed by their id, in a descending order (the lowest number first)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags