2016-05-29 43 views
0

我想從頭開始使用引導創建一個WordPress主題 我正在使用從GitHub獲得的文件,並從中實現了很多東西。你可以在Github找到它。這個名字是: twittem/WP-引導-navwalker使用bootstrap創建wordpress主題,並註冊菜單區域有問題

現在我創建菜單/註冊菜單區域,並用下面的代碼:

<?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'); 

這樣的菜單顯示出來之後,但有一個錯誤以上它是:

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} () 

我不知道如何解決這個錯誤或如何處理它。有人可以請幫助。

回答

2

變化function theme_setup(){function wpb_theme_setup(){

掛鉤add_action('after_setup_theme','theme_setup');試圖調用不存在的函數。

+0

非常感謝你 – user2296604

+0

不客氣。您可以點擊「接受答案」框,以便其他人知道問題已得到解答。 –

+0

我不知道接受盒在哪裏 – user2296604