Skip to content

Instantly share code, notes, and snippets.

@leepettijohn
Created October 3, 2016 10:12
Show Gist options
  • Select an option

  • Save leepettijohn/a39edea21a0cc08241334a610c6d6978 to your computer and use it in GitHub Desktop.

Select an option

Save leepettijohn/a39edea21a0cc08241334a610c6d6978 to your computer and use it in GitHub Desktop.
Order Posts by order number
/* Also, add the plugin Simple Page Ordering to enable the ability to drag and drop posts to a specified order
add_action( 'genesis_before_loop', 'ntg_do_query' );
/** Changes the Query before the Loop */
function ntg_do_query() {
$posttype = get_post_type();
if( $posttype == 'portfolio'){
global $query_string;
query_posts( wp_parse_args( $query_string, array( 'orderby' => 'menu_order', 'order' => 'ASC' ) ) );
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment