Skip to content

Instantly share code, notes, and snippets.

@ckaklamanos
Last active October 17, 2015 08:58
Show Gist options
  • Save ckaklamanos/5b9c25311bb9f12f0d29 to your computer and use it in GitHub Desktop.
Save ckaklamanos/5b9c25311bb9f12f0d29 to your computer and use it in GitHub Desktop.
Wordpress Better page management
// Add excerpt to pages
add_action( 'init', 'custom_add_excerpts_to_pages' );
function custom_add_excerpts_to_pages() {
add_post_type_support( 'page', 'excerpt' );
}
/*
Add Page Order column to Pages List Admin page
*/
add_filter('manage_pages_columns', 'custom_columns');
function custom_columns($columns) {
$columns['order'] = 'Order';
return $columns;
}
add_action('manage_pages_custom_column', 'custom_show_page_order_column');
function custom_show_page_order_column($name) {
global $post;
switch ($name) {
case 'order':
$views = $post->menu_order;
echo $views;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment