Title: including index.php
Last modified: August 18, 2016

---

# including index.php

 *  [greatbug](https://wordpress.org/support/users/greatbug/)
 * (@greatbug)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/including-indexphp/)
 * What I would like to do is to include the WordPress index.php in another php 
   page. I’ve created my own CMS/layout system, and I just want to make use of WP’s
   powerful blogging features (comments, trackbacks, pingbacks). I’ve created a 
   striped-down WP theme that only displays the relevant blog items, but when I 
   try to include WP’s index.php from a sub-dir, it errors out with the following:
 * `Fatal error: Call to a member function on a non-object in /var/www/wordpress/
   wp-includes/functions.php on line 1068`
 * using the latest WP 1.5
 * Where’s my problem?

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

 *  [mattread](https://wordpress.org/support/users/mattread/)
 * (@mattread)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/including-indexphp/#post-192622)
 * GreatBug, that sounds like a problem with the query string. I would try including
   the wp-config.php, then below that include your actual template file, index.php
   from your theme, instead of just the WP index.php.
 *  Thread Starter [greatbug](https://wordpress.org/support/users/greatbug/)
 * (@greatbug)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/including-indexphp/#post-192627)
 * still getting the same error.
 * homepage.php:
 * `<?php 
    /* Short and sweet */ define('WP_USE_THEMES', true); include('/var/www/
   wordpress/wp-config.php'); include('/var/www/wordpress/wp-content/themes/basic/
   index.php'); ?>
 *  Thread Starter [greatbug](https://wordpress.org/support/users/greatbug/)
 * (@greatbug)
 * [21 years, 3 months ago](https://wordpress.org/support/topic/including-indexphp/#post-192629)
 * to clarify–
 * homepage.php is in /var/www/
    and what /var/www/wordpress/index.php renders is
   what I’d like to include().

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

The topic ‘including index.php’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 2 participants
 * Last reply from: [greatbug](https://wordpress.org/support/users/greatbug/)
 * Last activity: [21 years, 3 months ago](https://wordpress.org/support/topic/including-indexphp/#post-192629)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
