Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #26368

    Is it possible to customize what order the children pages list in?

    #130166

    Yes – in sidebar.php search for

    $children = wp_list_pages("title_li=&child_of=". $parent ."&echo=0");

    and replace it with

    $children = wp_list_pages("sort_column=post_title&title_li=&child_of=". $parent ."&echo=0");

    You can also use a different value for “sort_column” – supported values are:

    ‘post_title’ – Sort Pages alphabetically (by title) – default

    ‘menu_order’ – Sort Pages by Page Order. Note the difference between Page Order and Page ID. The Page ID is a unique number assigned by WordPress to every post or page. The Page Order can be set by the user in the Pages→Edit panel. See the example below.

    ‘post_date’ – Sort by creation time.

    ‘post_modified’ – Sort by time last modified.

    ‘ID’ – Sort by numeric Page ID.

    ‘post_author’ – Sort by the Page author’s numeric ID.

    ‘post_name’ – Sort alphabetically by Post slug.

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Children pages listed on sidebar are in alphabetical order’ is closed to new replies.