First of all I would like to tell you that I am kinda new in the topic of developing wordpress. On the other hand I find it very powerful that we can 'code' our wordpress site!
My issue is the following: I would like to change(replace) my main navigation menu by post or category. Because if i click on a post of a category, my navigation menu will go to the standard one which i do not want. I tried to look for some solution over the internet and here but I could not find any, unfortunately. I came up with the following idea then: What if I change my menu args in the functions.php? My code snippet what I wrote in the functions.php is the following:
add_filter( 'wp_nav_menu_args', 'bb_wp_nav_menu_args' );
function bb_wp_nav_menu_args( $args = '' ) {
if( is_single('123') ) {
$args['menu_id'] = '12';
}
if( is_single('116') ) {
$args['menu_id'] = '12';
}
if( is_category('15') ) {
$args['menu_id'] = '12';
}
return $args;
}
Here the 123 and 116 are the ID's of posts. And naturally the number 15 is the category...but unfortunately it does not work. What is your opinion? Where does the problem lie? Would you be so kind as to help me in this matter? Thanks in advance and sorry if my question is very newby!
Edit: I would like to add some additional information because these might be relevant: I am using Hueman theme and I would like to change the header menu instead of the topbar menu. Thanks again!