Order by menu_order and title?

We can order pages by title.

Also we can sort them by menu_order.

Read More

Is it possible, to order pages by menu_order and title at the same time?

Related posts

Leave a Reply

2 comments

  1. I don’t yet have enough rep to comment so I will have to post this tidbit as an answer instead.

    Since WP 4.0, you may compound any of the available orderby values by padding them as a space-delimited list.

    This is somewhat documented here

    orderby will also parse a space-delimited set of columns:

    $q = new WP_Query( array( 'orderby' => 'title author' ) );

    Prior to 4.0, there was a problem: the value for order would only be
    applied to the last value that you passed in that space-delimited list,
    producing an ORDER BY clause like:

    ORDER BY post_title, post_author DESC

    In answer to your question, you may use 'orderby' => 'menu_order title'