0

I am trying to create a WordPress theme from scratch using bootstrap I am using a file I got from GitHub and have implemented a lot of things from it. You can find it in Github . The name is : twittem/wp-bootstrap-navwalker

now I am creating menus / registering menu area and have used the following code :

<?php 
require_once('wp_bootstrap_navwalker.php');

//theme support
function theme_setup(){
//nav menu
    register_nav_menus(array(
      'primary' => __('Primary Menu')
    ));
}
//for the above function to work we need tocreate an addaction function, which lets us choose a hook to run it
//the one we want is aftr set up theme

  add_action('after_setup_theme','wpb_theme_setup');

After doing this the menu shows up but there is an error above it which is :

Warning: call_user_func_array() expects parameter 1 to be a valid callback, function 'wpb_theme_setup' not found or invalid function name in C:\wamp\www\wordpress-bootstrap\bootstrap\wp-includes\plugin.php on line525
Call Stack
#   Time    Memory  Function    Location
1   0.0005  241464  {main}( )   ..\index.php:0
2   0.0007  244632  require( 'C:\wamp\www\wordpress-bootstrap\bootstrap\wp-blog-header.php' )   ..\index.php:17
3   0.0011  264688  require_once( 'C:\wamp\www\wordpress-bootstrap\bootstrap\wp-load.php' ) ..\wp-blog-header.php:13
4   0.0016  275768  require_once( 'C:\wamp\www\wordpress-bootstrap\bootstrap\wp-config.php' )   ..\wp-load.php:37
5   0.0027  402232  require_once( 'C:\wamp\www\wordpress-bootstrap\bootstrap\wp-settings.php' ) ..\wp-config.php:89
6   0.3356  21979856    do_action( )    ..\wp-settings.php:377
7   0.3357  21981408    call_user_func_array:{C:\wamp\www\wordpress-bootstrap\bootstrap\wp-includes\plugin.php:525} ( )

I dont know how to solve this error or what to do about it. Can someone please help.

1 Answer 1

2

Change function theme_setup(){ to function wpb_theme_setup(){

The hook add_action('after_setup_theme','theme_setup'); is trying to call a function that doesn't exist.

Sign up to request clarification or add additional context in comments.

1 Comment

You're welcome. You might click the "accept answer" box so others will know the question has been answered.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.