• Resolved peiqinglong

    (@peiqinglong)


    I want to do what is done here with the codex. Integrate the look and feel with WordPress. I know I’m supposed to stick:

    <?php
    /* Short and sweet */
    define('WP_USE_THEMES', false);
    require('./wp-blog-header.php');
    ?>

    into whatever external php page I want to use WordPress functions on, but its not working. I’m just getting a blank page. I want to be able to use WP Functions such as get_header, stylesheet_directory, etc. in the wiki. I’ve tried sticking that line in MediaWiki’s index.php and in the skin I’m creating also, but neither method works. Anyone have any luck with this? Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    www.remarpro.com Admin

    This line:
    define('WP_USE_THEMES', false);
    is unnecessary. You don’t need to explicitly define it false. It doesn’t hurt, but it doesn’t help either.

    And this line:
    require('./wp-blog-header.php');

    Assumes that WordPress is installed in your current directory. The single dot is the current directory path. If you have it in a different directory, you need to specify the path to it.

    Say your PHP page is /public-html/test/page.php. And your wordpress is installed in /public-html/wordpress/. In that case, you’d need to have this line:
    require('../wordpress/wp-blog-header.php');

    See? You have to tell it where the file is. The .. is the previous directory. You can also use the full complete path to the file, if you know it.

    Thread Starter peiqinglong

    (@peiqinglong)

    Otto,

    Gotcha! I was missing the additional period. That solved my problem.

    For future reference for anyone else trying to do this, my WP is in my root, so putting:

    <?php
    require('../wp-blog-header.php');
    ?>

    In the MediaWiki’s index.php file at the very top worked great!

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘wp-blog-header.php’ is closed to new replies.