I am attempting to order the results from WP_query by a custom value. Specifically, I want to use the name field, however, the name field is going to be made up of many words separated by spaces. I specifically want to order by the last word in the name field.
Currently, my query args are this:
$args = array(
'post_parent' => $post->ID,
'order' => 'ASC',
'orderby' => 'name',
'post_type' => 'page',
'posts_per_page' => 8,
'paged' => get_query_var( 'paged' ),
'meta_key' => 'team_school',
'meta_value' => $school_type
);
I have seen information on the meta_query
argument but nothing that indicates I can do what I am looking to do.