Using orderby=meta_value doesn't display duplicate connections
-
I have a connection type called people_to_shows, where the people often have many connections to the same show. The duplicate connections display fine on the frontend, unless I’m ordering them by meta_value. So this WP_Query works as expected:
$credits_connected = new WP_Query( array( 'connected_type' => 'people_to_shows', 'connected_items' => get_queried_object(), 'connected_direction' => 'any', 'post_type' => 'any', 'nopaging' => true ) );
Output:
Show A – Role on show #1
Show A – Role on show #2
Show B – Role on show #1
Show B – Role on show #2
etcBut this query doesn’t work:
$credits_connected = new WP_Query( array( 'connected_type' => 'people_to_shows', 'connected_items' => get_queried_object(), 'connected_direction' => 'any', 'post_type' => 'any', 'nopaging' => true, 'orderby' => 'meta_value', 'meta_key' => 'start_date' ) );
(start_date is a custom field)
Output:
Show A – Role on show #1
Show B – Role on show #1
etc (e.g. it’s only showing the first connection and skipping the rest)Other orderby options work fine (title, date etc), it’s just meta_value that doesn’t seem to work.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Using orderby=meta_value doesn't display duplicate connections’ is closed to new replies.