• In my hosting root directory i have the ‘blog’ directory where wordpress is installed.
    I also have index.php in the root directory, which is my website’s index.
    My problem is to make the index.php show contents from the ‘blog’ directory
    My index.php has a portion of code from the sidebar.php in the ‘blog/wp-content/themes/default’
    this part:

    • <h2>Categories</h2>
      <?php wp_list_cats(‘sort_column=name&optioncount=1&hierarchical=0’); ?>

    It shows up well only when i put my index.php file into the ‘blog/wp-content/themes/default’ directory
    My need is to have the index.php file in the root directory displaying content from the /blog directory,
    do you know if this is possible? I think I must add some includes and dependencies but don’t know
    which, how, or where…

Viewing 1 replies (of 1 total)
  • Put this at the top of your root index (before everything else!)
    <?php
    require('./path-to-your-blog/wp-blog-header.php');
    ?>

    in this way all the WP functions will work on that page.
    Ask if you have more questions.

Viewing 1 replies (of 1 total)
  • The topic ‘Show blog contents out of wp-content directory’ is closed to new replies.