Forums

[resolved] Using WP php tags outside of WP Blog (4 posts)

  1. safesimplelife
    Member
    Posted 4 years ago #

    I want to be able to use WP php tags (like the login/logout functions) on a page outside of the WP directory.

    I've researched and placed this at the top of my page:
    <?php
    require('./topics/wp-blog-header.php');
    get_header();
    ?>

    however I keep receiving the following error when going to my page:
    Warning: main(./topics/wp-blog-header.php) [function.main]: failed to open stream: No such file or directory in /home/.punch/deanbigbee/worlddominationplan.com/topics/tempindex.php on line 2

    Anyone have any ideas?

  2. Kafkaesqui
    Moderator
    Posted 4 years ago #

    Try:

    require('/home/.punch/deanbigbee/worlddominationplan.com/topics/wp-blog-header.php');

    Providing the absolute path to a file should always work.

  3. safesimplelife
    Member
    Posted 4 years ago #

    You're the best. That did it. Thanks so much!!

  4. Netwonder
    Member
    Posted 3 years ago #

    So i tried the same thing with my site and I got this. Help!

    Oops:
    This theme only works with WordPress 2.1.* or higher. You seem to have an outdated version of wordpress. Please download the latest WordPress to use this theme and also get the latest security patches.> Fatal error: Call to undefined function: bloginfo() in /home/content/t/a/l/talkingscience/html/blogs/wp-content/themes/TS/header.php on line 8

Topic Closed

This topic has been closed to new replies.

About this Topic