How about using get_page_by_path()
, then using the ID from the returned object in an exclude filter?
add_filter('wp_page_menu_args','my_nav_exclude_pages');
function my_nav_exclude_pages( $args = array() ) {
$homepage = get_page_by_path('my-page-slug');
$args['exclude'] = join( ',', array( $args['exclude'], $homepage->ID ) );
return $args;
}
Related Posts:
- How to set permalink structure via functions.php
- date_i18n() issue
- WordPress Multisite: Have the same header and footer of main-blog on all sub-blogs
- Display site admin profile fields in header.php
- How to test for MU via functions.php?
- Same footer on all multisites blogs
- How can I disable/hide certain themes in multisite?
- Change the template of multiple multisite pages at the same time
- Is it a bad practice to use switch_to_blog in the frontend?
- Theme Development for WordPress Multisite Installation
- WordPress empty Nav Menu error
- multisite: global menu containing network site links?
- Acivate all themes multisite wide automatically
- Question regarding WP multisite feature
- Featured Image meta box not showing up
- Where do files uploaded via Media Manager get stored in MU?
- How to allow users to create their own website within my domain? [closed]
- Different text on different sites in a multisite setup
- How to make a theme unable to be used on a multisite network?
- Sample Theme Options page for Multisite – what to consider
- Get themes’s images path in WordPress Multisite
- Multi Site Setup, Child Themes, Getting Style Sheet Directory
- Converting a theme to a child theme in a network
- HTTP Error when uploading images over specific dimensions
- How to get blog-id of an MU site from functions.php
- fetch all post from wp multisite network and sort all the post in descending order on the basis of “Created by ” term
- How to get full native language instead of iso?
- How to make menus, footer, sidebars multi language
- Why does the theme of secondary site load the primary one in WordPress Multisite? [closed]
- Let user publish posts on community page
- How to hide blog by id wordpress multisite listing
- Can I use WP Multi-site on a sub-domain with a different theme but use all the original site’s posts/pages?
- Mutlisite in wordpress is not working
- background_image support multiple image size?
- How can I demonstrate themes well?
- Theme Options Doesn’t Work On WP Multisite
- Subsite theme mystery man replacement with Buddypress on main site [closed]
- Custom link color or stylesheets
- how can I add an icon/image for a child theme?
- When to use add_action(‘init’) vs add_action(‘wp_enqueue_scripts’)
- How to change admin bar color scheme in MP6 / WP 3.8 front end?
- How to add Color Picker in Theme Options for the following?
- Theme Review: post thumbnail, header image, content width
- How to enqueue scripts and styles only when there are needed?
- Unexpected width and srcset attributes for the_post_thumbnail();
- Pushing updates to your premium theme
- The best way to add stylesheets to WordPress
- WordPress custom post type page dysplay 404 error
- How wordpress handle upload images and how to use them in the code
- Change loop order via form or link (jquery, not URL)
- how to create theme based widget that can be drop in sider bar or footer
- CSS in child theme not overriding the parent theme [closed]
- List categories and exclude child categories
- Implement advanced search
- Difficulty loading jQuery with wp_enqueue_script
- Unable to check if image uploaded by wp_image_editor exists using file_exists function
- How to add styles set by user in the customizer
- Use second time navigation.js in underscores [closed]
- Add attachment for all images in post
- Is it possible to include an HTML flat-file website inside a WordPress theme?
- Static home page with “Blog” inside?
- Overrite parent functions using child functions
- How can I change the theme of different posts using a plugin?
- Include jQuery (or anything) inside Custom Options Panel’s tag
- WordPress 3 botches my Custom Meta Box values on Save
- Exclude custom post type from search conflict with get_posts
- How to obfuscate theme directory URLs
- Remove specific published page when theme deactivated
- Is there a WordPress boolean for “theme_customizer_active()”?
- Weirdness in jQuery supplied with WordPress
- Get Post’s Excerpt Without the Wrapping tags and the Read More link
- Templates dropdown not appearing using _s theme (underscores)
- get_header action not working
- Navbar- disable “onClick” drop-down
- Injecting pre-defined text from custom page template to editor
- Changing footer depending on URL (poli language site)
- Update Specific Key Value in Complex `wp_options` object
- Using Foundation 5 off-canvas-menu with WordPress
- Parent/Child pages
- Cart displayed above header
- “The REST API did not process the context query parameter correctly.” Custom theme conflicting with Media Library
- Wrong activation/confirmation link in email
- Post Featured Image Custom Sizing?
- Theme: dropdown hover menu not showing up in IE/Edge
- How to enqueue scripts properly with ES6 webpack?
- Disabling wordpress added class
- how to ensure responsiveness in wp themes? [closed]
- PHP Script on a template page & dealing with URI’s
- home is not working in wordpreess
- Responsive Images with art direction
- Correct form of escaping and localization – functions.php breadcrumbs
- Activating theme in local MAMP installation results in HTTP ERROR 500
- New created Theme leads to malfunctioning Xampp Apache –> functions.php is cause
- Where to find this broken link in order to remove it
- Woocommerce Theme Reviews / Comments
- Moving Posts and Users Only to New Site
- Want to display page content after password prompt without page reload
- How to highlight current menu bar base on the URL?
- Why do some sites show themes/”themename” as the only theme?
- How can i move my product name & price from below thumbnail to be the rollover content in Avada & Woocommerce?