Hello Community,
I would like to have a different Navigation Menus for my Posts in my Blog Sites.
I have a function in functions.php which helped me achieve different menus for different pages, based on the PageID.
function modify_nav_menu_args( $args )
{
if( is_front_page() && $args[‘theme_location’] == ‘avia’ || is_page(1737) && $args[‘theme_location’] == ‘avia’ )
{
$args[‘menu’] = ‘LandingPage_Menu_EN’;
}
if( is_page([7687, 26372]) && $args[‘theme_location’] == ‘avia’ )
{
$args[‘menu’] = ‘Facebook_Nav_Bar_DE’;
}
return $args;
However, this logic does not work, as I can not add the ca. 200 posts IDS for the blogs and that would be not clever.
I would therefore apply a general logic for the post type.
Is there any unique identifier to the blog posts?
Any suggestion and even the evaluation formula for the posts would be appreciated.
Thanks and have a great day,
Hey Chris,
You can try the post category ID’s Or try the WordPress menu plugin Zen Menu Logic.
Best regards,
Vinay