• Developing my own theme. Appearance -> Menus works fine as i put the basic code in functions and added to the header file. Drag reordering however, is not currently working. I must be missing more code.

    in function file:

    <?php
    /*
     * Functions file
     * Includes all necesary files
     * PLEASE DO NOT EDIT THIS FILE IN ANY WAY
     *
     * @package custom
     */
    
    function register_my_menus() {
      register_nav_menus(
        array(
          'primary-menu' => __( 'Primary Menu' ),
          'secondary-menu' => __( 'Secondary Menu' )
        )
      );
    }
    add_action( 'init', 'register_my_menus' );
    
    ?>
    
    <?php
    /**
     * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
     */
    function custom_page_menu_args( $args ) {
    	$args['show_home'] = true;
    	return $args;
    }
    add_filter( 'wp_page_menu_args', 'custom_page_menu_args' );
    ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • I’d suggest getting rid of the:

    ?>
    
    <?php

    in the middle but other than that, it looks fine.

    Lisa

    (@berelsonhotmailcom)

    Well i THOUGHT I GOT IT!! I removed the theme location from the header.php file where this was called…
    I was using:
    <?php wp_nav_menu( array( 'theme_location' => 'primary' ) ); ?>

    when I removed the theme location ref, it allowed user reordering:
    <?php wp_nav_menu( array( 'primary' ) ); ?>

    However, I did have this home fallback code following in functions which disrupted update postings: Once this was removed, it worked.

    <?php
    /**
     * Get our wp_nav_menu() fallback, wp_page_menu(), to show a home link.
     */
    function custom_page_menu_args( $args ) {
    	$args['show_home'] = true;
    	return $args;
    }
    add_filter( 'wp_page_menu_args', 'custom_page_menu_args' );
    ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Reorder feature of Appearance -> Menus not working’ is closed to new replies.