title: Include Wordpress Core into own Scripts
body: <p>I'm trying to "Import" the Wordpress core into an own script to use the functionality such as wp_query etc. I've created an script in a subdirectory (own framework) and want to extend it by wordpress, but everytime the script throws an error:</p>
  
  <p><b>Fatal error</b>:  Call to a member function add_rewrite_tag() on a non-object in <b>.../wordpress/wp-includes/taxonomy.php</b> on line <b>333</b><br /></p>
  
  <p>such as (when I remove the add_action( 'init', 'create_initial_taxonomies', 0 )):</p>
  
  <p><b>Fatal error</b>:  Call to a member function add_rewrite_tag() on a non-object in <b>.../wordpress/wp-includes/post.php</b> on line <b>1006</b><br /></p>
  
  <p>The non-object is the $wp_rewrite-object. I've echo'ed something and figured out that first $wp_rewrite is valid and at the next call not. I've changed nothing at the WP core files.</p>
  
  <p>I try to include the core by calling:</p>
  
  <pre><code>    require_once(BASE_PATH . 'wp-load.php');
  </code></pre>
  
  <p>Has anybody some ideas for me?</p>
  
  <p>thanks</p>