Skip to content

Instantly share code, notes, and snippets.

@doitonlinemedia
Created February 19, 2019 11:31
Show Gist options
  • Save doitonlinemedia/cde9c324cfcb02d60d462a5b0606da88 to your computer and use it in GitHub Desktop.
Save doitonlinemedia/cde9c324cfcb02d60d462a5b0606da88 to your computer and use it in GitHub Desktop.
Adjust query by menu order.php
/**
* Adjust gebouwen querie
*/
function gebouwen_adjust_queries($query) {
if (!is_admin() && is_post_type_archive('gebouwen') && $query->is_main_query()) {
$query->set('orderby', 'menu_order');
$query->set('order', 'ASC');
}
}
add_action('pre_get_posts', 'gebouwen_adjust_queries');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment