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
- WordPress Shortcodes.. printf is outputting a random number… Can’t figure out WHY?
- Remove metabox from WordPress menu editor page?
- Custom Walker_Nav_Menu issue with variables on PHP 7.3
- How to add an arrow to menu items has submenus
- How to make my custom widget appear within WordPress widgets? Plugin development
- wp_nav_menu returns menu list in ascending order. How can I arrange the menu same as dashboard menu
- get widget number from array dynamically
- WordPress, AJAX and pre_get_posts using conditional tags
- Adding widgets to my plugin page instead of WordPress dashboard
- Unique icons next to each WordPress menu item
- Child page menu in sidebar
- Title Case WordPress Menu Items
- Hide subcategories (widget)
- Secondary navigation menu on one page
- Remove class in nav_menu_link_attibutes filter
- Why my image upload button is not working in wordpress widget area?
- Adding a widget function into the php theme file
- WordPress Quick Question . How to Get Parent Link in Submenu in My Code
- How to edit widget code to add unique class name to each div?
- Trying to store submenu items to render out after main menu
- Detecting classes, adding widgets, and adding divs in with a Nav Walker
- How to change menu order item
- If has $title in widgets
- Custom Menus: dynamic highlighting problem with custom home link
- get_the_title() gets printed out twice
- Archives shortcode displaying above widget title
- If tag equals then show else show
- Widgets in the loop if active
- Show latest posts in a plain HTML website custom widget [closed]
- Add item to top of menu using a filter in functions.php
- Adding PHP in the menu
- Two menus show up
- How to determine if the sidebar is empty? Or not active?
- How to make widget title accept php?
- Is it bad to add html to a widget by closing and reopening the php tags?
- Register a menu – Error Header
- Widget back end radio button issue
- How to style one item from main navigation?
- Show About and Contact Us page when they’re clicked in the top menu.
- Hook called before text widget save
- Conditional statement for dates
- New walker for walker_nav_menu to change inside container data
- Add data-id attribute to child page links
- Parsing Menu Items and Blog Posts
- How can I display a div ONLY if it is not a certain term page
- Add login hyperlink to secondary navigation menu
- Don’t show certain div on front page?
- If ‘editor’ is empty, then
- Add class to DIV depending on page loaded
- Automatically add images to a menu
- How to: Conditionally Enqueue JS and Stylesheets, for Custom Post Type (Single and Archive Templates)
- Add value to new attribute inside WordPress menu items
- Widgets not showing on custom theme
- My website is not showing Footer section
- wp_nav_menu not working correctly in my underscores theme
- Undefined index for default custom theme option
- Remove conditional tag from header
- Menu Items fail to save correctly, cause reset of related page metadata
- Dropdown menu for categories
- Menu Custom Data Attributes
- WordPress widget and customize.php not working in Ubuntu16.04 VPS
- How to display different submenus?
- Correctly Using checked function of WordPress
- Get the name of menu item with wp_nav_menu
- Notice: Trying to get property of non-object
- How can I display Custom Post type Custom Columns and its Content in a Dashboard Widget?
- How to use wp_nav_menu to create custom dropdown menu?
- Display an image based on field value
- Multidimensional Array
- How to modify mobile nav menu text in theme
- Output only links using wp_nav_menu()
- Get css class of menu item in custom menu structure
- How to add aria role and schema markup to custom walker container
- How can I use custom menus with a Bootstrap WordPress theme?
- Nav menu from plugin to theme
- How to get post category list as select in front-end?
- Adding Additional Variables on Menus Page
- Simple php in wordpress widget [closed]
- How to use title attributes in sidebar widget?
- Extend Menu Walker Output
- Nav-Menu not showing up
- Show different website layout if no sidebar added
- display specific widget to a page
- Dynamically display font icons in widget
- Custom navigation menu with awsAccordion
- “if parent category is” conditional?
- how to add a div inside wp_page_menu
- Correct code to use php in text widget
- How to correctly load a different version of main menu based on the user language in WordPress? Is it a good solution?
- Why in this WordPress theme I can’t see the Main Menu?
- Show login greeting above sub-menu links?
- Why can’t I add a custom image in my navigation?
- Conditional for Post Format
- Remove submenu item from list
- wp nav menu: show submenu below li item