Sounds like you need ancestors rather than just parents. That way on deeper pages, you’ll be able to determine whether Offer is a grandparent/great-grandparent/etc. page.
global $post;
$ancestors = $post->ancestors;
if($ancestors || is_page('Offer')) {
// your menu here
}
Related Posts:
- WordPress menu deletes when trying to add a hook
- Second Navigation inside header
- conditional: if is page, and all subpages
- Beyond widget side menu editing, with the php page, custom template
- How to list categories by page id in wordpress
- Hide main div if wp_nav_menu is empty
- Create Image Uploader for Widget
- How to remove a metabox from menu editor page?
- Displaying a variable stored in functions.php inside widget
- Check if widget has content
- How to create different menu’s for not logged in visitors and for logged in members?
- How to add active class to custom menu using while loop and wp_list_pages
- How to place login logout link on menu that redirects users back to current page?
- List authors with posts in a category
- How to add Shortcode (font awesome) in widget title?
- Unusable menus and “Illegal widget setting ID: nav_menu_item[]” error
- dynamic sidebar not showing anything
- javaScript in section of WP API
- Style every second widget?
- How to group 2 radio buttons in a widget?
- PHP Deprecated: WP_RSSjb has a deprecated constructor
- wp nav menu: add attributes to menu items [duplicate]
- custom widget on the footer
- Missing sidebar parameter “fix” – before_content
- Change Navigation Bar based on logged in or not
- How to add just one specific page to widget without plugin?
- how could I load a different template part by page
- How can I Add a variable PHP in the Menu Nav
- Dynamic Sidebars & Echo
- Where to place PHP code that inserts (or doesn’t insert) menu item?
- Adding an Avatar to the Top Nav Bar
- Add data attribute to each li in menu
- WordPress Shortcodes.. printf is outputting a random number… Can’t figure out WHY?
- Remove metabox from WordPress menu editor page?
- How to add an arrow to menu items has submenus
- wp_nav_menu returns menu list in ascending order. How can I arrange the menu same as dashboard menu
- Unique icons next to each WordPress menu item
- If tag equals then show else show
- How to make widget title accept php?
- New walker for walker_nav_menu to change inside container data
- Add data-id attribute to child page links
- Add login hyperlink to secondary navigation menu
- If ‘editor’ is empty, then
- How to: Conditionally Enqueue JS and Stylesheets, for Custom Post Type (Single and Archive Templates)
- wp_nav_menu not working correctly in my underscores theme
- Remove conditional tag from header
- WordPress widget and customize.php not working in Ubuntu16.04 VPS
- Notice: Trying to get property of non-object
- How to use wp_nav_menu to create custom dropdown menu?
- Multidimensional Array
- How to get post category list as select in front-end?
- Simple php in wordpress widget [closed]
- Nav-Menu not showing up
- Show different website layout if no sidebar added
- random reason on refresh
- How to tell if a user has gone in and created a menu
- Add a select-option to the default widgets
- Woocommerce getting top level category parent and make all sub categories have the same template and menu
- Hard-coding a shortcode as the last menu item in primary navigation?
- Some problems in custom widget
- Add class to ul and li in wp_na
- Nav Walker that shows only children and siblings of top level parent menu item
- how to changes mobile menu toggle breakpoint in WordPress
- How to display already created menus via php?
- dynamic php menu with hidden sub-categories only showing when the category name is clicked
- Add widget area from visual editor
- How to let mobile navigation menu close when link is clicked?
- Display specific page if user signed in
- Add element after navigation element title don’t works like I expect
- is_user_logged_in() not working in homepage
- Dynamic_sidebar load in string makeup
- Customizing the output of the archive and category widget without altering the original behavior of the widget
- How to create a sub-page of sub-page?
- Featured Products not showing up in “Featured” area of homepage
- (Who to follow) Twitter widget
- Add disclaimer before certain posts and pages
- Are WordPress widgets cached?
- wp_nav_menu doesn’t work in a duplicate server
- How I can add div to menu?
- Update title of every instance of widget using text field
- Add extra markup to WP menus
- if user is admin display admin link and logout link else display logout only
- Are widget arguments always set inside My_Widget::widget()?
- Add code only for blog posts
- WP_Widget dynamic field array with external AJAX
- Using ‘array’ method in wp_nav_menu causes it to disappear
- If Month=Particular month display content [closed]
- Name Input from widget displays Sidebar name instead of saved data
- WordPress – show number of comments for each post in widget
- key( $GLOBALS[‘wp_registered_sidebars’] ) is always showing the same value
- WP_Nav Highlight Parent Issue
- PHP Widget and do_shortcode
- if is_home(), change class of menu-item-225 of wp_nav_menu
- Change order that the menu is generated with wp_list_pages
- I am extending Walker_Nav_Menu: How can I get the number of children elements of the current item?
- How to define template directory in this widget code
- How do I modify the with wp_nav_menu()
- Make a permalink to the most recent blog post
- Inserting a shortcode into a genesis menu?
- Issues trying to add a href statment with PHP into a PHP Echo Statement [closed]