Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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

The Error : Fatal error: Call to a member function add_rewrite_tag() on a non-object in /wp-includes/taxonomy.php on line 333

share|improve this question

2 Answers 2

up vote 0 down vote accepted

Found the solution. just add this code before including wp-blog-header.php.

global $wp_rewrite;

source: https://github.com/kayue/WordpressBundle/issues/2

share|improve this answer

Read Don’t include wp-load, please. Then look at this answer to understand the difference to the load of wp-blog-header.php.

share|improve this answer
I changed wp-load.php to wp-blog-header.php and still getting the same error. –  alhoseany Apr 7 '12 at 23:06

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.