WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

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.