Skip to content

Instantly share code, notes, and snippets.

@slightlyoffbeat
Created October 22, 2013 20:41
Show Gist options
  • Save slightlyoffbeat/7107733 to your computer and use it in GitHub Desktop.
Save slightlyoffbeat/7107733 to your computer and use it in GitHub Desktop.
Allows you to set custom order for custom post types. Requires: 'supports' => array('page-attributes'),
function my_custom_archive_order( $vars ) {
if ( !is_admin() && isset($vars['post_type']) && post_type_supports($vars['post_type'], 'page-attributes') ) {
$vars['orderby'] = 'menu_order';
$vars['order'] = 'ASC';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment