• Resolved amanda0405

    (@amanda0405)


    I am having trouble importing a category menu. Most of the categories are left out of the menu, I am usually just left with one. All the page menus are working well. Is there a way I can fix this.

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

    (@capuderg)

    Hi Amanda,

    you probably tested this in plugin version 1.4.0, right?

    Could you please test this also with our OCDI plugin version 2.0.0, which will soon be officially updated: https://dl.dropboxusercontent.com/u/14641788/OCDI/OCDI-2.0.0-RC2.zip

    In 2.0.0 we fixed the category hierarchy import and maybe that’s causing your problem…

    Let me know how it goes.

    Take care!

    Thread Starter amanda0405

    (@amanda0405)

    Unfortunately it didn’t resolve the issue. Deleting and recreating the menu before export did fix most of the problem – the full menu is now imported, however it is not showing up in the correct place and has to be manually selected.

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi,

    what exactly do you mean with:

    …however it is not showing up in the correct place and has to be manually selected.

    You mean the menu location has to be manually selected?

    The menu locations and custom menu widgets have to always be selected manually, the issue is in how the menus are created in WordPress…

    However you can hook into our after import action hook and assign a menu to a menu location. The code would look something like this:

    
    function ocdi_after_import_setup() {
        // 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,
            )
        );
    }
    add_action( 'pt-ocdi/after_import', 'ocdi_after_import_setup' );
    

    Let me know, if this is what you were looking for, or did I misunderstand…

    Take care!

    Thread Starter amanda0405

    (@amanda0405)

    Hi, thanks for responding. I explained this poorly.

    The problem is now that the menu I am using is selected via a module (I am using Divi Parent theme)and for some reason it does not import the menu selection – category. It reverts to no selection and then defaults to the primary menu. I hope this is clearer.

    Plugin Author Gregor Capuder

    (@capuderg)

    Hi,

    I’m sorry, I’m not familiar with the Divi theme, so I don’t understand how the theme works…

    It sounds like you will have to set the menu selection for your theme with some custom code for your Divi theme settings. You would still need to use the example code above, but modify the code for menu assignment. So, the after_import hook is what you need, but I can’t help you with your theme specific settings, because I don’t know how the theme works. I would recommend that you ask the Divi support on how to set the menu via PHP code and then use that code in our after_impot hook (example above).

    Take care!

    Thread Starter amanda0405

    (@amanda0405)

    Thank you

    Plugin Author Gregor Capuder

    (@capuderg)

    No problem 🙂

    Good luck and have a nice day!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Importing category menus’ is closed to new replies.