我遵循Wordpress Codex的指南:Integrating Wordpress with Your Website 但我收到以下错误:
Declaration of Walker_Page::start_lvl() should be compatible with that of Walker::start_lvl() [ On E:\Documents\work\devenv\xampp\htdocs\orp\blog\wp-includes\post-template.php Line 1071 ]
Declaration of Walker_Page::end_lvl() should be compatible with that of Walker::end_lvl() [ On E:\Documents\work\devenv\xampp\htdocs\orp\blog\wp-includes\post-template.php Line 1071 ]
Declaration of Walker_Page::start_el() should be compatible with that of Walker::start_el() [ On E:\Documents\work\devenv\xampp\htdocs\orp\blog\wp-includes\post-template.php Line 1071 ]
Declaration of Walker_Page::end_el() should be compatible with that of Walker::end_el() [ On E:\Documents\work\devenv\xampp\htdocs\orp\blog\wp-includes\post-template.php Line 1071 ]
Declaration of Walker_PageDropdown::start_el() should be compatible with that of Walker::start_el() [ On E:\Documents\work\devenv\xampp\htdocs\orp\blog\wp-includes\post-template.php Line 1116 ]
Declaration of Walker_Category::start_lvl() should be compatible with that of Walker::start_lvl() [ On E:\Documents\work\devenv\xampp\htdocs\orp\blog\wp-includes\category-template.php Line 915 ]
Declaration of Walker_Category::end_lvl() should be compatible with that of Walker::end_lvl() [ On E:\Documents\work\devenv\xampp\htdocs\orp\blog\wp-includes\category-template.php Line 915 ]
Declaration of Walker_Category::start_el() should be compatible with that of Walker::start_el() [ On E:\Documents\work\devenv\xampp\htdocs\orp\blog\wp-includes\category-template.php Line 915 ]
Declaration of Walker_Category::end_el() should be compatible with that of Walker::end_el() [ On E:\Documents\work\devenv\xampp\htdocs\orp\blog\wp-includes\category-template.php Line 915 ]
Declaration of Walker_CategoryDropdown::start_el() should be compatible with that of Walker::start_el() [ On E:\Documents\work\devenv\xampp\htdocs\orp\blog\wp-includes\category-template.php Line 966 ]
Declaration of Walker_Comment::start_lvl() should be compatible with that of Walker::start_lvl() [ On E:\Documents\work\devenv\xampp\htdocs\orp\blog\wp-includes\comment-template.php Line 1400 ]
Declaration of Walker_Comment::end_lvl() should be compatible with that of Walker::end_lvl() [ On E:\Documents\work\devenv\xampp\htdocs\orp\blog\wp-includes\comment-template.php Line 1400 ]
Declaration of Walker_Comment::start_el() should be compatible with that of Walker::start_el() [ On E:\Documents\work\devenv\xampp\htdocs\orp\blog\wp-includes\comment-template.php Line 1400 ]
Declaration of Walker_Comment::end_el() should be compatible with that of Walker::end_el() [ On E:\Documents\work\devenv\xampp\htdocs\orp\blog\wp-includes\comment-template.php Line 1400 ]
Redefining already defined constructor for class WP_Widget [ On E:\Documents\work\devenv\xampp\htdocs\orp\blog\wp-includes\widgets.php Line 93 ]
Declaration of Walker_Nav_Menu::start_lvl() should be compatible with that of Walker::start_lvl() [ On E:\Documents\work\devenv\xampp\htdocs\orp\blog\wp-includes\nav-menu-template.php Line 109 ]
Declaration of Walker_Nav_Menu::end_lvl() should be compatible with that of Walker::end_lvl() [ On E:\Documents\work\devenv\xampp\htdocs\orp\blog\wp-includes\nav-menu-template.php Line 109 ]
Declaration of Walker_Nav_Menu::start_el() should be compatible with that of Walker::start_el() [ On E:\Documents\work\devenv\xampp\htdocs\orp\blog\wp-includes\nav-menu-template.php Line 109 ]
Declaration of Walker_Nav_Menu::end_el() should be compatible with that of Walker::end_el() [ On E:\Documents\work\devenv\xampp\htdocs\orp\blog\wp-includes\nav-menu-template.php Line 109 ]
Fatal error: Call to a member function add_rewrite_tag() on a non-object in E:\Documents\work\devenv\xampp\htdocs\orp\blog\wp-includes\taxonomy.php on line 333
相当多的错误!我在Wordpress v3.3.1和PHP v5.3.1上
我的php.ini错误报告是error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT
,但不确定error_reporting是否在代码中的某处覆盖。
我在Wordpress php文件中查看并看到wp-includes/class-wp-walker.php
中的函数参数不匹配问题,但我不想只是通过匹配参数来修补它,而不知道真正的问题。
你有什么线索可能会发生在这里吗?
非常感谢!
编辑:修正了所有声明错误,现在只剩下一个
Fatal error: Call to a member function add_rewrite_tag() on a non-object in E:\Documents\work\devenv\xampp\htdocs\orp\blog\wp-includes\taxonomy.php on line 334
似乎$wp_rewrite
未定义,其值为 null 。事实上,wp-includes\taxonomy.php
答案 0 :(得分:2)
许多错误(" X声明应该兼容")实际上是由php的E_STRICT触发的警告,无论如何都会启用。
最后一个似乎是wordpress试图为它的分类法加载一些值,该类处理URL重写和搜索引擎友好的URL,但是失败或没有正确配置。
答案 1 :(得分:0)
好的,我将初始化代码移到了脚本的顶部。
<?php
/* Short and sweet */
define('WP_USE_THEMES', false);
require('./wp-blog-header.php');
?>
解决了它!
由于