Title: PHP Include wordpress
Last modified: August 19, 2016

---

# PHP Include wordpress

 *  724547
 * [17 years, 11 months ago](https://wordpress.org/support/topic/php-include-wordpress/)
 * I’m trying to php include wordpress’ index.php in my index.php, I dont use wordpress
   themes, so installing it on the main directory or having a redirect is out of
   the question. I was able to do this before with previous versions. Any idea what
   I can do?
 * My site is [http://lacerated.org](http://lacerated.org) and I’m testing it out
   on [http://lacerated.org/index2.php](http://lacerated.org/index2.php) but I get
   this error:
 * >  Warning: require(./wp-blog-header.php) [function.require]: failed to open 
   > stream: No such file or directory in /home/lacerate/public_html/wp/index.php
   > on line 4
   > Fatal error: require() [function.require]: Failed opening required ‘./wp-blog-
   > header.php’ (include_path=’.:/usr/lib/php’) in /home/lacerate/public_html/wp/
   > index.php on line 4

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

 *  [OthelloBloke](https://wordpress.org/support/users/othellobloke/)
 * (@othellobloke)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/php-include-wordpress/#post-805702)
 * I haven’t tried or test this, but you might want to try:
 * `<?php print file_get_contents('http://www.blahblah.com/index.php'); ?>`
 *  [cosmosnow](https://wordpress.org/support/users/cosmosnow/)
 * (@cosmosnow)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/php-include-wordpress/#post-805703)
 * Your index.php should ONLY have `<?php
    /* Short and sweet */ define(‘WP_USE_THEMES’,
   true); require(‘wp-blog-header.php’); ?>`
 * Then, go to WP’s default theme in your themes folder and customize the content
   to be your layout/custom theme. Make sure ‘default theme’ is enabled, just in
   case, for your WordPress.
 * Just ask if you have any more problems, or have questions about this method. 
   It’s what I use, and we can always work around it.
 *  [whooami](https://wordpress.org/support/users/whooami/)
 * (@whooami)
 * [17 years, 11 months ago](https://wordpress.org/support/topic/php-include-wordpress/#post-805704)
 * actually what the OP is doing is perfectly fine given what hes trying to do ..
   the problem is the ‘wp’ in the path thats in the error.
 * where are your wordpress files located? In your root or inside wp/??
 *  841284
 * [17 years, 10 months ago](https://wordpress.org/support/topic/php-include-wordpress/#post-805721)
 * Hi!
 * I used <?php print file_get_contents(‘[http://machow.net76.net/wordpress/index.php&#8217](http://machow.net76.net/wordpress/index.php&#8217););?
   > to include wordpress into my page: [http://machow.net76.net/](http://machow.net76.net/)
 * But it totally destroys the layout –> [http://machow.net76.net/?page=NB](http://machow.net76.net/?page=NB)
 * WordPress just jumps out of the <div> it is supposed to stay in, and destroys
   a bunch of layout-items. =/
 *  841284
 * [17 years, 10 months ago](https://wordpress.org/support/topic/php-include-wordpress/#post-805722)
 * solved the problem..
 * had to place set the overflow of the div to automatic and put the navigation 
   <div> over the wordpress-div =)

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

The topic ‘PHP Include wordpress’ is closed to new replies.

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 5 participants
 * Last reply from: 841284
 * Last activity: [17 years, 10 months ago](https://wordpress.org/support/topic/php-include-wordpress/#post-805722)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
