WordPress backend:How to hide some specific pages under Pages–>All Pages

I used the following code snippet into one of my project. Use the code snippet into the functions.php within the main PHP tag: // HIDE SOME PAGES FROM THE EYE OF EDITOR function wpse20131126_exclude_pages_from_admin($query) { global $pagenow, $post_type; if (is_admin() && current_user_can(‘editor’) && $pagenow==’edit.php’ && $post_type ==’page’) { $query->query_vars[‘post__not_in’] = array( ’77’, // the security … Read more

How to detect when admin user is on the All Posts page?

If you need exactly on All Posts page, Not on All Pages, nor All Products or etc – if ( ‘edit.php’ === $GLOBALS[‘pagenow’] && ( isset( $GLOBALS[‘typenow’] ) && ” == $GLOBALS[‘typenow’] || ‘post’ == $GLOBALS[‘typenow’] ) ) { // Do what you like… }

How to create a menu item which is not a page

In Appearance » Menus, is you are using WordPress 3.7+, then from the left, under Links area, put your URL and then name the link. If you don’t want to link the menu to any physical link, then just put a hash (#) there.

This code won’t find authors page?

Building URLs to WP resources in this fashion is fragile and shouldn’t be done. You should use appropriate API function to generate the links, in this case probably get_author_posts_url().

Admin – no Featured image choice in create new/page|post

Your theme has not registered support for post thumbnails. You need to add one of these as appropriate: add_theme_support( ‘post-thumbnails’ ); add_theme_support( ‘post-thumbnails’, array( ‘post’ ) ); // Posts only add_theme_support( ‘post-thumbnails’, array( ‘page’ ) ); // Pages only add_theme_support( ‘post-thumbnails’, array( ‘post’, ‘movie’ ) ); // Posts and Movies See the Codex (link above) … Read more