• Resolved kvnmcwebn

    (@kvnmcwebn)


    Hi I was adding a custom menu to the functions.php file
    The menu was too long so I duplicated this code:

    add_action( 'init', 'my_custom_menus' );
    function my_custom_menus() {
    	register_nav_menus(
    		array(
    			'Footer-nav' => __( 'Footer-nav' ),
    
    		)
    	);
    }

    instead of doing this

    add_action( 'init', 'my_custom_menus' );
    function my_custom_menus() {
    	register_nav_menus(
    		array(
    			'Footer-nav' => __( 'Footer-nav' ),
    			'Footer-nav_two' => __( 'Footer-nav_two' ),
    		)
    	);
    }

    I am using the editor in the admin

    here is the domain:

    Now the site is broke and I get this error:

    Fatal error: Cannot redeclare my_custom_menus() (previously declared in /…/sitedomain/html/wp-content/themes/custom/functions.php:477) in /…/sitedomain/html/wp-content/themes/custom/functions.php on line 492

Viewing 1 replies (of 1 total)
  • Thread Starter kvnmcwebn

    (@kvnmcwebn)

    ah when I got back to my own computer and checked the functions file on the server it showed that the duplicate declaration had not been removed.

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