Click here to Skip to main content
15,881,600 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ' wordpress_footer_menu' not found or invalid function name in C:\xampp\htdocs\wordpress\wp-includes\class-wp-hook.php on line 286

function.php
<?php
function wordpress_menu() {
	register_nav_menu('primary','Top Navigation');
}
add_action('init','wordpress_menu');

function wordpress_footer_menu() {
	register_nav_menu('footer','Footer Navigation');
}
add_action('init',' wordpress_footer_menu');

add_theme_support('post-thumbnails');

?>

header.php
<!DOCTYPE HTML>


<meta charset= "<?php bloginfo('charset'); ?>" />
<title><?php bloginfo('name'); ?> | <?php wp_title(); ?>

<?php wp_head(); ?>



	<div id="wrapper">
    	<div id="header">
        	<div id="logo">
            	<h2><?php bloginfo('name'); ?></h2>
                <h4><?php bloginfo('description'); ?></h4>
        	</div>
            <div id="menu">
            	<?php wp_nav_menu(array('theme_location' => 'primary')); ?>
            </div>
        </div>


footer.php
</div>
<div id="footer">
© wordpress.com All rights reserved.
</div>
<?php wp_footer(); ?>

index.php
<?php get_header(); ?>
<div id="body_content"></div>
<?php get_footer(); ?>

class-wp-hook.php
foreach ( $this->callbacks[ $priority ] as $the_ ) {
				if( ! $this->doing_action ) {
					$args[ 0 ] = $value;
				}

				// Avoid the array_slice if possible.
				if ( $the_['accepted_args'] == 0 ) {
					$value = call_user_func_array( $the_['function'], array() );
				} elseif ( $the_['accepted_args'] >= $num_args ) {
					$value = call_user_func_array( $the_['function'], $args );
				} else {
					$value = call_user_func_array( $the_['function'], array_slice( $args, 0, (int)$the_['accepted_args'] ) );
				}
			}
		} while ( false !== next( $this->iterations[ $nesting_level ] ) );

		unset( $this->iterations[ $nesting_level ] );
		unset( $this->current_priority[ $nesting_level ] );

		$this->nesting_level--;

		return $value;
	}


What I have tried:

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function ' wordpress_footer_menu' not found or invalid function name in C:\xampp\htdocs\wordpress\wp-includes\class-wp-hook.php on line 286
Posted
Updated 21-Sep-20 22:33pm
v2

I don't know php, but the leading space in
' wordpress_footer_menu' 
may be the issue.
 
Share this answer
 
Comments
Member 13761429 9-May-18 23:55pm    
thanks man.. u r right.....
Does class-wp-hook.php have access to the function? It should have an include or require or require_once or similar for function.php, e.g.

require_once('function.php');
 
Share this answer
 
Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'newsmag_login_errors()' not found or invalid function name in /home/netflixl/public_html/wp-includes/class-wp-hook.php on line 287
 
Share this answer
 
Comments
Richard Deeming 4-Jun-20 13:53pm    
Your error message is not a "solution" to this already-solved question.
CHill60 5-Jun-20 7:31am    
If this was meant to be a question then you need to use the red "Ask a Question" link at the top of the page.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900