Skip to content

Instantly share code, notes, and snippets.

@eri-trabiccolo
Created February 20, 2015 15:26
Show Gist options
  • Save eri-trabiccolo/39e8c6b68934d1e97ae0 to your computer and use it in GitHub Desktop.
Save eri-trabiccolo/39e8c6b68934d1e97ae0 to your computer and use it in GitHub Desktop.
Different menu
add_filter('tc_menu_args', 'my_menus');
function my_menus($args){
$page_menu = array(
//page_id => menu_id
'19' => '14',
'2' => '2'
);
if ( is_page() && array_key_exists(tc__f('__ID'), $page_menu) )
$args['menu'] = $page_menu[tc__f('__ID')];
return $args;
}
@Isabelann
Copy link

I found this on my search on the forums, but I just want to know how to actually use it. (I understand how to get my num for my menus)

I would like most of my main pages to have a sub-menu for what is in that section. I want to use a side bar on those pages to show that menu.

I like the way the widget for customizer pro works for custom menu, but it makes that menu global for the entire site. Here is what I want, but I want a different menu on each page that needs one. http://www.wordpress.robbinsbuilders.com/about-us/

I think I understand the different-menu.php code will help identify the menu, but how to I apply it to the side bar?

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment