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

    (@greatbug)

    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

    (@greatbug)

    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.