Title: require(&#8216;./wp-blog-header.php&#8217;);
Last modified: August 19, 2016

---

# require(‘./wp-blog-header.php’);

 *  [Yeowza](https://wordpress.org/support/users/yeowza/)
 * (@yeowza)
 * [16 years ago](https://wordpress.org/support/topic/requirewp-blog-headerphp-3/)
 * Hello I’m designing a theme but having some trouble..
 * I have an index.php and I include this line at very start
 * `<?php define('WP_USE_THEMES', true); require('./wp-blog-header.php'); ?>`
 * The WP_USE_THEMES is self explanatory and the wp-blog-header I guess is
    to start
   up wordpress.
 * Anyways I put a link on the page which points to articles.php and I include this
   line inside articles.php but I get this error.
 *     ```
       Warning: require(./wp-blog-header.php) [function.require]: failed to open stream: No such file or directory in C:\xampp\htdocs\wp-content\themes\Tutorial\articles.php  on line 1
   
       Fatal error: require() [function.require]: Failed opening required './wp-blog-header.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\wp-content\themes\Tutorial\articles.php on line 1
       ```
   
 * I’m not sure why it works in index.php and not in articles.php, it looks like
   it cannot find ./wp-blog-header.php (im not sure where that is btw, but index.
   php seems to find it okay)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [Yeowza](https://wordpress.org/support/users/yeowza/)
 * (@yeowza)
 * [16 years ago](https://wordpress.org/support/topic/requirewp-blog-headerphp-3/#post-1481101)
 * ahh i see, wp-blog-header.php is located on root
 * I guess ./ points to root then, why would it load with index.php and not with
   articles.php though? the are both in same directory
 *  Thread Starter [Yeowza](https://wordpress.org/support/users/yeowza/)
 * (@yeowza)
 * [16 years ago](https://wordpress.org/support/topic/requirewp-blog-headerphp-3/#post-1481107)
 * I moved wp-blog-header.php into wp-content/themes/ThemeName/ and it works..
 * So this means that the problem is because ./ is referring to
    wp-content/themes/
   ThemeName
 * Is there way for me to specify root when I do not know the URL?
 * ex: [http://www.website.com/wp-blog-header.php](http://www.website.com/wp-blog-header.php)
 *  Thread Starter [Yeowza](https://wordpress.org/support/users/yeowza/)
 * (@yeowza)
 * [16 years ago](https://wordpress.org/support/topic/requirewp-blog-headerphp-3/#post-1481108)
 * ok I think I fix it..
 * what I did was just go some directory’s up relativly
 * `<?php require('./../../../wp-blog-header.php'); >`
 * This just goes 3 directories up, where wp-blog-header.php is located.. gonna 
   keep testing to see if there are any problems.
 * I’m planning on distributing this theme so I guess it will keep working as long
   as the user does not move files around
 * still not sure why `<?php define('WP_USE_THEMES', true); require('./wp-blog-header.
   php'); ?>` works with index.php though
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [16 years ago](https://wordpress.org/support/topic/requirewp-blog-headerphp-3/#post-1481113)
 * Your theme should not be including WordPress files like that at all.
 * Look at some existing themes for examples.
 * Basically, you’re doing it wrong.
 *  Thread Starter [Yeowza](https://wordpress.org/support/users/yeowza/)
 * (@yeowza)
 * [16 years ago](https://wordpress.org/support/topic/requirewp-blog-headerphp-3/#post-1481130)
 * It works pretty good though Otto42. I am making a theme but it is more of a website
   with wordpress integrated into it. (But distributed like a theme)
 * Once I finish it i’ll show it off to ya

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘require(‘./wp-blog-header.php’);’ is closed to new replies.

 * 5 replies
 * 2 participants
 * Last reply from: [Yeowza](https://wordpress.org/support/users/yeowza/)
 * Last activity: [16 years ago](https://wordpress.org/support/topic/requirewp-blog-headerphp-3/#post-1481130)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
