You can do this by using pre_get_posts() which will adjust the query before it’s run. Therefore we can exclude pages from the query.
function wpse_hide_special_pages($query) {
// Make sure we're in the admin and it's the main query
if ( !is_admin() && !is_main_query() ) {
return;
}
// Set the ID of your user so you can see see the pages
$your_id = 1;
// If it's you that is logged in then return
if ($your_id == get_current_user_id()) {
return;
}
global $typenow;
// Only do this for pages
if ( 'page' == $typenow) {
// Don't show the special pages (get the IDs of the pages and replace these)
$query->set( 'post__not_in', array('8', '15', '14', '22') );
return;
}
}
add_action('pre_get_posts', 'wpse_hide_special_pages');
Hope that helps.
Related Posts:
- A way to automatically install pages on theme install?
- Form Submitting Error with get_template_part()
- What is the right way to include a wp-admin file in your theme?
- Is it possible to manipulate the list of page templates?
- How to change admin bar color scheme in MP6 / WP 3.8 front end?
- Pages: frontpage.php, home.php, posts page etc
- Posts in multiple Categories different single.php
- Adding Content Areas to Custom Page Template
- Where is default wp_head() implemented?
- wp_insert_post breaks rewrite rules
- Can’t edit style.css in subdirectory of my theme?
- Enqueued Stylesheets Effecting Admin Styles
- the_excerpt() not showing manual excerpt for Pages
- How to highlight the current page in the nav menu?
- How to regenerate thumbnails when they’re stored on S3
- Do I really need the div class entry?
- Sub folder CSS that’s read by Admin panel
- Displaying part of every child page?
- wordpress custom theme import and export options for sample data [closed]
- how do you create an admin interface in plugin for your theme
- Warning/Error in Admin Panel while developing theme
- How do I get the next page of posts link?
- Why is the Links Manager visible?
- Where can I access my custom page template?
- using jQuery Cycle by Malsup with WordPress Page and Gallery
- Excluding Pages not working
- How to add Bootstrap Tour JavaScript to WordPress Admin Panel Dashboard Widget
- Highest number of WordPress Custom Page Templates?
- How to create a custom template to admin dashboard
- Multiple TinyMCE Editors in one Admin Page
- How to add a button which saves the post then executes a function
- Create a new page in WordPress theme
- How to create a custom page(not a template) in a theme
- how to setup custom content structures
- How to Find the Page the Front Page is Using?
- How to place HTML tags in content from the_content()?
- Change the “Default Avatar” admin option via functions.php
- Need help with adding templates (archives and sitemap) to WordPress child theme
- Template for landing pages
- Issue On Displaying Pages with Post Name Permalink
- Why in the static pages of my theme are showing these information?
- Remove specific published page when theme deactivated
- Migrating to WordPress – but how will it do “structured” data?
- I’m using wp residence theme and want to display titile above the slider [closed]
- Iris color picker in custom theme option page not saving value
- How to code custom special page
- How to add custom meta box when you have a custom page template file
- How to track a users last visited page?
- Custom admin logo not showing after wordpress 4.5 upgrade
- WordPress Load Only Page Text
- How to add pages in wordpress using codes?
- How does the loop know which post to view?
- Pagination fuction in shortcode always displays on top
- Injecting pre-defined text from custom page template to editor
- Theme development: menu links a tabbed page with page jumps
- Custom theme template files
- Parent/Child pages
- WordPress Animation Adjustments
- Show only pages you are author of
- How do I open a post in a custom page in wordpress?
- Pages not displaying as sections on static page
- How to show metabox on page if it is using a template
- makeing a terms of use page that is part of the theme
- Creating a theme just to deploy a single page
- Problem with Displaying Custom Theme Page’s Content
- WordPress uploads do not show up and I see the white screen of death in some cases
- WordPress Twenty-Fourteen: How to Remove Home Page Header Image from Other Pages
- Alter theme pages on language switch
- wp_editor some functionality not working on custom theme
- Display content on Single page
- One-Page WordPress Template
- Create a variable with string, array or multiple values
- How to create multiple pages in a client theme?
- How can I display and excerpt of all pages with a meta_key and meta_value on index.php?
- Advantages/Disadvantages Using Theme Editor Instead of Pages
- Can you create a custom page with content in the center already defined?
- how to make a new page affected by a theme’s index.php layout?
- How to remove menu from WP-Admin menu
- How get the 10 most viewed pages (not post)
- How can I change the title of the Home link in the navigation bar?
- The content not wrapped in paragraph tags with get_page_by_title()
- Standard Way To Do Custom Work Within A Page?
- How to Disable Color Options?
- How do I get information about a page, such as featured image, except, and title?
- How do I make it super customisable?
- What is the best practice for customizing a plugin’s JavaScript/jQuery?
- Possible to add “Template” selector to posts?
- Adding LazyLoad and InfiniteScroll to WordPress Theme
- How Can I Create a List of Values to Be Iterated Through via WordPress Customization API?
- Using an if statement in the theme customizer page
- How to edit my theme for full width?
- Fetch wordpress video attachment with post ID
- How can I develop multiple widgets for a WordPress theme?
- How to create first post, fifth post full width, rest in three columns and so on
- Translate a child theme with pure PHP and gettext
- Pagination: Keep prev and next link even on the first/ last page
- Next and previous post link shows error in first and last post
- Media & Plugin screens stall
- Is wp_mail plugin territory?
- HTML TO WP Theme : Submenu goes down wp_nav_menu