Created
October 24, 2016 14:24
-
-
Save ibrahimkholil/3d1411f3ab439de359d695e0449b161f to your computer and use it in GitHub Desktop.
WordPress: Enabling Page attributes for posts (sort_order)
This file contains 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
/********************************************************** | |
function.php add below the code | |
************************************* | |
function posts_order() | |
{ | |
add_post_type_support( 'post', 'page-attributes' ); | |
}**/ | |
add_action( 'admin_init', 'posts_order' ); | |
/********************************************************** | |
psot query page add below the code | |
***************************************/ | |
$order_posts = new WP_Query(array( | |
'post_type' => 'post', | |
'post_status' => 'publish', | |
'orderby' => 'menu_order', | |
'order' => 'ASC', | |
) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment