• Hi,

    iam a theme developer and iam about to fix the final bugs for my theme so i came across that bug.

    After re-ordering the menu points in Appearence -> Menus it doesn’t save. I can drag and drop them, but whenever i hit save the old position gets reverted. (it orders after the date)

    Anyone got any ideas where to search for this issue?

    Here is how i register my menu in the functions.php

    // register menus
    function register_main_menu() {
        register_nav_menu('main-menu', 'Top Primary Menu');
    }
    
    add_action( 'init', 'register_main_menu' );

    The header.php
    <?php wp_nav_menu( array( 'theme_location' => 'main-menu' ) ); ?>

    Any ideas would be great. ??

    Thanks a lot,
    mike

Viewing 7 replies - 1 through 7 (of 7 total)
  • Off the top of my head I can’t see anything wrong with your code. I saw a similar thread recently where menu changes would save in some browsers but not ie for some reason, so it might be worth trying a different browser if you haven’t already. At the very least it might help narrow down the source of the problem.

    EDIT: sorry if this is a silly question, but just to check: have you tried editing the menu using a different theme? It could be a problem with user permissions or something else in your setup rather than your theme code.

    Thread Starter paperboy123

    (@paperboy123)

    Hi Chris,

    thanks a lot for your feedback. Unfortunatly it works with other themes so the bug must be in my own but since the above lines are the only ones about the menu i really dont know where to search.

    @browser: Not a browser problem.

    Thanks,
    mike

    Ok, when you say the old position gets reverted does that mean that the menu items go back to their old places in the edit menus screen, or do they stay where you put them there but fail to update on the site itself?

    Thread Starter paperboy123

    (@paperboy123)

    They go back to their old places after i click “Save Menu”.

    I’ll be honest and say this has me a little puzzled, but I’m happy to help narrow things down a bit, here are a few more thought:

    This sounds almost, but not quite like the custom menu limit issue some people experience. It could be worth trying the solution listed on that page in case you’ve stumbled into something similar.

    Again, these are things you may have already done, but it’s always worth disabling any plugins you may have installed to see if that fixes things. I would also turn on debugging if you haven’t already.

    If you’re happy to share your code at this stage I could also try your theme in my test environment this evening to see if I can reproduce the issue.

    You might be hitting a custom menu limitation issue.

    Thread Starter paperboy123

    (@paperboy123)

    Hey Guys,

    thanks a lot for your help. After creating a new functions.php i narrowed the problem down to this line:

    // ckeditor jquery adapter
    	wp_register_script( 'ckeditor-jquery-adapter', get_template_directory_uri() . '/content-editor/ckeditor/adapters/jquery.js', false, '1.0.0' );
    	wp_enqueue_script( 'ckeditor-jquery-adapter' );

    Its the jquery adapter for the CK Editor i use in my themes content editor. I don’t know exactly what causes the problem but i will exclude the script for now in the menu section.

    Thanks again!
    mike

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