Menu Save
-
We are using local theme import with your plugin.
Everything is perfect. After imported we want the menu automatically checked.( Primary Menu)
//Our Theme Code
register_nav_menus( array(
‘primary_menu’ => esc_html__( ‘Primary Menu’, ‘text-domain’ ),
) );Created Menu on Our Demo by name “Main Menu” and chcked “Primary Menu”
What we need to implemented in this code.
// Assign menus to their locations.
$main_menu = get_term_by( ‘name’, ‘Main Menu’, ‘nav_menu’ );set_theme_mod( ‘nav_menu_locations’, array(
‘main-menu’ => $main_menu->term_id,
)
);
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Menu Save’ is closed to new replies.