• Resolved josflachs

    (@josflachs)


    Hi, I’m trying to create my first demo but I have trouble getting the menu to work, after the installation is complete. It’s there, but I have to manually activate it. How do I to set this automatically?

    I’m using the code in After Import Custom Code Execution:
    $main_menu = get_term_by( 'name', 'Main Menu', 'nav_menu' );

    ‘Main Menu’ I set to main-menu, which is the name of the menu.

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

    (@capuderg)

    Hi,

    you are on the right track ??

    I would suggest you to read our guide here and just recheck that all your parameters are correct.

    Take care!

    Thread Starter josflachs

    (@josflachs)

    I read it. Top to bottom, (many, many) more times than I’d like. But I don’t understand it, my lack of php is abysmal. Sorry.

    My menu is named ‘main-menu’. The id is 5. With the settings above the menu is imported. The menu and all the items are there. But I have to manually activate it. How do I set ocdi correctly with ‘main-menu’ ?

    Hi, Gregor

    The code you referring does not work with block themes since it uses navigation blocks not classic theme menu locations. What to do for navigation blocks by default it assign to the same menu for all pages

    set_theme_mod( 'nav_menu_locations', [

                'main-menu'=> $main_menu->term_id, // replace 'main-menu' here with the menu location identifier from register_nav_menu() function in your theme.

            ]

    ????);

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi @josflachs,

    are you also using a block based theme and have the same issue as @yahyahaled has mentioned? I just want to make sure the issue is the same for both of you?

    Do you maybe a have an example of a free block theme with an XML import file I could use to test and debug this issue?

    Thank you and have a nice day!

    Thread Starter josflachs

    (@josflachs)

    No, I’m working with TinyMCE, Elementor and Hello-Elementor.

    Hi Gregor,
    Is there any update regarding import issues in navigation blocks for block themes. Still waiting for your update.

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi,

    we can’t reproduce this issue on our end, so it would be best if you could share a free theme and an XML import file that will demonstrate this issue.

    Once we can reproduce the issue, we can also debug it and fix it (if possible).

    Take care!

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Menu doesn’t activate’ is closed to new replies.