if you want to show the menus only on child pages then you need to change your conditional statement:
global $post;
//only on children of 269
if ('269' == $post->post_parent){
//menu for Sport & Fitness pages
?>
<div id="seventh" class="widget-area" role="complementary">
<?php dynamic_sidebar( 'sidebar-7' ); ?>
</div><!-- #second .widget-area -->
<?php
//only on children of 118
}elseif( '118' == $post->post_parent){
//menu for Eat Smart pages
?>
<div id="eighth" class="widget-area" role="complementary">
<?php dynamic_sidebar( 'sidebar-8' ); ?>
</div><!-- #second .widget-area -->
<?php
//everything else including parent pages
}else{
//default menu
}
Related Posts:
- Loading scripts only if a particular shortcode or widget is present
- How Can I Register Menus and Widgets Conditionally Based on Theme Options/Settings?
- Conditional Tags Based on Previously Viewed Posts
- How to make widget appear conditionally
- Loading scripts only if a particular shortcode or widget is present
- menu in different page in different style
- how to add multiple menu in custom menu widget?
- Programmatically add widgets to sidebars
- Text Widget creates a
- Get Widget Instance inside Widget
- Add the sidebar/widget editor to the post edit screen?
- WP_Widget deprecated error in WordPress V4.3
- What is the quickest way to make a widget?
- Changes in widget customizer not triggering ‘save and publish’
- Remove before_widget / after_widget content from Wp_Widget_Text
- Insert a span inside widget title to give a different color to the second word
- What is the use case for the “Class” parameter in register_sidebar?
- Add a select box to all widgets
- Big side banners
- How to execute SQL SELECT query and see the results?
- WordPress “include TEMPLATEPATH” or?
- Need help adding additional controls to a custom widget Part 2
- How to add the widgets manually to the sidebar?
- How to check if widget has automatic title
- Display sidebar that created in functions.php
- Image picker widget
- When you register a sidebar in WordPress, is it possible to choose in what order it appears in the admin
- How to enable “shift-click to edit this widget” functionality on a custom widget?
- Make compatible custom menu widget for Twitter Bootstrap
- WordPress widget args – classname?
- Custom Tag Cloud widget missing tags
- Change HTML structure for custom menu in sidebar
- Full width layout for custom post type pages
- wp_count_posts, wp_count_terms and wp_count_comments for specific user?
- PHP 7 – Class Method Compatibility Issue
- Why does WordPress stores widget options in a multidimensional array?
- what is option_name on database that store the information of current initiate widget in frontend sidebar?
- Widget – Store and update data
- Run JS after widget settings are saved?
- Shortcode displays always first. Once again
- Can I create drag and drop widgets like iGoogle in WordPress?
- Making the default “Latest Posts” WordPress Widget Show Thumbnails
- How to remove a widget from the sidebar on specific page?
- When adding a widget, what kind of widget should I used to add images and text and styling?
- Add description to custom text widget and display the 5 recent post titles
- Add individual tag to widget title in sidebar
- Prev / Next menu item
- How to allow your custom widget as block in gutemberg editor
- How to save widget fields generated from an array?
- Create a widget to use shortcode?
- Print owned created widget
- isSavingPost() for widgets
- Newbie: Help with Vertical Spacing on Footer Widget [closed]
- Content of widgets keep disappearing over and over again
- Add visual editor style only on widgets.php page
- Edit and make class-wc-widget-featured-products.php update-proof
- Display Widgets Horizontally in Area [closed]
- Copy Widget Settings because of changed IDs
- Why is my custom widget breaking another one?
- Show a widget as a sidebar fallback
- disbale default widgets on theme activation
- in_widget_form detect sidebar id
- function WP_Widget::widget() must be over-ridden in a sub-class. when create new Widget
- I have a widget area in my header. How can I have that display a different widget depending on what group is shown?
- change widget to display excerpt instead of content
- How to move top widget to the left – Responsive Theme WordPress
- How to register a widget when saving a post?
- Using more widget in main page cause slow loading WordPress? [closed]
- Add links widget to self-hosted blog?
- how can i display all youtube videos from a users youtube account
- Link a widget or find the php that creates the widgets
- How to add Ajax to the default widget calendar to support next/previous months loading?
- prevent custom widget file names from showing in Appearance > Editor
- Add a widget to a static front page
- Last Update time in widget
- Adding dashboard widgets to show – custom post type stats, information from other plugins
- Problem with WP_Query loop and search term
- After adding widget the style is messing up
- Widget title showing below widget
- Get a list of all Widgets registered in WordPress admin widgets-area
- Add Class to Custom Menu Widget ul
- How to list categories by page id in wordpress
- how to get value of a select box in custom widget wordpress
- Using the_widget Multiple Times
- Does current page contain widget or sidebar
- Nonce and widget
- Paginate recent posts widget
- How to give a File Upload option in wordpress Widget backend?
- Adding Widgets to Reactor Theme (based on Foundation 4)
- Can I use widgets & shortcode if I need to return an array?
- Widget area does not show any contents for specific users in admin interface. How to go about debugging?
- Neaten content — different widget or CSS change?
- Unique widget id in sidebar
- Taxonomies not showing in WP Dashboard Right Now widget
- trying to Change to wp_register_sidebar_widget
- How to delete Jetpack Widgets from the Widgets page in admin panel [closed]
- How to customize dynamic_sidebar rendering? [closed]
- Widget does not work with WooCommerce enabled
- How to show WordPress Dashboard Widgets on Frontend?
- How can I add a toggle element into an image box element? [closed]