Hi,
You can try adding making your page/post id list into an array.
Example: from is_page('1,2,3')
, change to is_page( array(1,2,3) )
.
You can also try adding more condition parameters like is_category()
.
Example: || is_category('category_slug')'
|| is PHP’s “or” logical operator. category_slug
can be changed to your target category slug.
Knowing these things, we can change the code into this:
add_filter( 'wp_nav_menu_args', 'bb_wp_nav_menu_args' );
function bb_wp_nav_menu_args( $args = '' ) {
// change the menu in the Header menu position
if( $args['theme_location'] == 'primary' && is_page( array(14901,15068,15058,15060,15062,15066,15064,15070,15072,15056,14916,15074,15076) ) || is_category('category_slug') ) {
$args['menu'] = '756';
}
return $args;
}