Static Front Page (7 posts)

  1. sedelstein
    Posted 10 years ago #

    I'm trying tos set up a static front page as described in http://codex.wordpress.org/Creating_a_Static_Front_Page

    Per the instructions I put the following line in the html file in the root directory

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

    (Blog is the folder off the root where WP is installed.)

    However, the header is not pulled into the page.

  2. James Huff
    Support Representative
    Posted 10 years ago #

  3. moshu
    Posted 10 years ago #

    Per the instructions I put the following line in the html file in the root directory

    That's the problem - the .html.
    It will work only with an index.php If you can, just rename your index file and it should work.

  4. sedelstein
    Posted 10 years ago #

    Actually, I do have that installed and I think it's doing what it's supposed to do. Let me describe what I'm trying to do. Maybe I'm going about it wrong.

    I'd like my web site to have the same look as WP as far as headers and footers are concerned with WP installed in a subdirectory. So I thought that what I should do is use the code in my first message to "insert" the header in the site's html files. Like I said. that hasn't worked as described in the article but I'm probably doing something wrong.

    What the static-front plug-in does is start the blog with the Page that has a slug of Home. But what I'm trying to do is have my home page in a normal html file outside the WP and again, have all the web pages take on the same look and feel.

    Boy, I hope I'm being clear enough.

  5. sedelstein
    Posted 10 years ago #

    I think our messages crossed. I didn't see the renaming suggestion. I renamed the file and it works.


  6. moshu
    Posted 10 years ago #

    Yes, now it is clear.
    1. As I said before: no php code will work in a html file.
    2. You can just manually redo/style your html index file to look like your blog's theme.

    Edit. OK, so it works :) Glad to hear that.

  7. mattman
    Posted 10 years ago #

    EDIT: OOPS, Too Slow :(


    did you read what moshu said?

    It must be a php file if you wish to execute the code you pasted above.

    This should work:

    <?php define('WP_USE_THEMES', false);
    require('blog/wp-blog-header.php'); get_header();?>
    <div id="content" class="narrowcolumn">
    <h1 style="color:#000;">Welcome to my site</h1>
    Hello and welcome to my site. You can go to my web
    page about how to improve your digital photography
    techniques with your new digital camera; or you
    can <a title="Go to my Blog" href="/wordpress/index.php">go
    to my blog.</a>
    <?php get_footer(); ?>

    Save that as index.php in the root directory of your server (or wherever) and have the blog below in a directory called "blog"

Topic Closed

This topic has been closed to new replies.

About this Topic