Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
function wp_travel_customize_post_type( $query ) {
$post_type = travel_log_wp_travel_support_get_post_type();
if ( is_post_type_archive( $post_type ) ) {
// Display 50 posts for a custom post type called 'movie'
$query->set( 'posts_per_page', 50 );
$query->set('orderby', 'meta_value');
$query->set('meta_key', 'wp_travel_start_date');
$query->set('order', 'ASC');
return;
}
}
add_action( 'pre_get_posts', 'wp_travel_customize_post_type', 1 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.