• Hello,

    I am trying to show recent posts on my home page, and I have read many different posts on this in which the same solution always seems to work (of course not for me).

    I have tried making a separate .php file in my root directory for this (obviously not the WordPress install directory). Here is the code I have so far:

    <?php
    define(‘WP_USE_THEMES’, false);
    require($_SERVER[‘DOCUMENT_ROOT’].’/blog/wp-blog-header.php’);
    query_posts(‘showposts=1’);
    ?>

    I have also tried get_header(); and using a plugin there but to no avail.

    When I go to visit the page I receive an error saying no such file exists. I then changed it to the absolute path for the require function, but then I get a call to undefined function error…

    Any help will be greatly appreciated.

  • The topic ‘Trouble Implementing WordPress In Different Directory’ is closed to new replies.