Created
October 3, 2016 10:12
-
-
Save leepettijohn/a39edea21a0cc08241334a610c6d6978 to your computer and use it in GitHub Desktop.
Order Posts by order number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* 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