I get this error while trying to load wordpress in a smarty template. But when I visit wordpress I dont get that error any where.
the code I use to load wordpress is :
{php}include $_SERVER['DOCUMENT_ROOT'].'/wordpress/wp-load.php';
get_header();{/php}
The Error :
Fatal error: Call to a member function add_rewrite_tag() on a non-object in /wp-includes/taxonomy.php on line 333
Read Donât include wp-load, please. Then look at this answer to understand the difference to the load of
wp-blog-header.php
.Found the solution.
just add this code before including wp-blog-header.php.
source: https://github.com/kayue/WordpressBundle/issues/2