I am trying to change the wp_nav_menu based on the current post_type displaying.
But i cant do it without changing the core files. includes/helper-main-menu.php
an apply_filters would be nice in the next update :)
i changed line 123:
'theme_location' => apply_filters( 'avia_wp_nav_main_menu', $avia_theme_location ),
functions.php
add_filter( 'avia_wp_nav_main_menu', 'test_nav' );
function test_nav()
{
global $post;
if( $post->post_type == 'showcase' )
return 'showcase-menu';
else
return 'avia';
}
Hi eaonflux!
Please try using this plugin – https://wordpress.org/plugins/zen-menu-logic/
Cheers!
Yigit
Thanks for your quick response.
But mine main rule is to use less plug-ins as possible.
but i will analyze that plug-in, maybe i can borrow some code from it so i dont have to change the core files with each update.
Greets,
eaonflux
p.s. but an apply_filters is still appreciated ;)
Hi!
Thank you for using Enfold.
Try to use this plugin then use the is_singular() conditonal function: https://wordpress.org/plugins/menu-items-visibility-control/
Cheers!
Ismael