• Resolved Christian Zimpel

    (@christianzimpel)


    Hi There,
    I try to manage the menu position after import.
    I saw the FAQ but I can’t get it work.

    Register follw menus:
    register_nav_menu( ‘primary’, ‘Header Menü’ );
    register_nav_menu( ‘secondary’, ‘Footer Menü’ );

    But I don’t know wehre to put what in the Code of the FAQ. (I feel very stupid now)
    Can you help me pleace?

Viewing 1 replies (of 1 total)
  • Plugin Author Gregor Capuder

    (@capuderg)

    Hi,

    are you a theme author trying to setup the after theme import?

    To assign the menu to a particular location after the demo import has finished, you have to add this code to your theme (in the functions.php file for example):

    
    function ocdi_after_import_setup() {
        // Get the menu with the name: "Main Menu".
        $main_menu = get_term_by( 'name', 'Main Menu', 'nav_menu' );
    
        // Set the above menu to the menu location called: "main-menu".
        set_theme_mod( 'nav_menu_locations', array(
                'main-menu' => $main_menu->term_id,
            )
        );
    }
    add_action( 'pt-ocdi/after_import', 'ocdi_after_import_setup' );
    

    That’s it.

    Take care!

Viewing 1 replies (of 1 total)
  • The topic ‘Menu’ is closed to new replies.