WordPress.org

Ready to get started?Download WordPress

Forums

Static home page feature in v 2.1 (15 posts)

  1. glaughton
    Member
    Posted 7 years ago #

    Ì have been trying to use the new static home page feature in WP 2.1. I have installed WordPress in a subdirectory (i.e. http://siteroot/blog) and I have created a new home page file in the root directory (i.e. http://siteroot/index.html). I then went into Admin, Options, Reading and set Front Page to display a Static page. However my new page is not listed in the drop-down box and I just get the About page. Have I missed a step? I am new to WP and am not sure what is meant to happen. I assume I must create links in my home page to go to the blog but when I go to http://siteroot/blog should it automatically redirect to http://siteroot or at least provide a link to Home. Any help/advice would be greatly appreciated.

  2. MichaelH
    Member
    Posted 7 years ago #

    Don't know that you even need the Front page setting if you just want WordPress to act as your main page:
    1. Delete/rename that index.html file
    2. In your admin panel, Options->General, change your Blog address (URL) to http://siteroot
    3. Put the following index.php in your web-root folder:
    <?php
    /* Short and sweet */
    define('WP_USE_THEMES', true);
    require('./blog/wp-blog-header.php');
    ?>

    This particular setup is described at: Giving_WordPress_Its_Own_Directory

  3. drmike
    Member
    Posted 7 years ago #

    From the other thread:

    Your index.html is not within your WP. You need to write a Page at Dashboard -> Write -> Page and it will display the content of that article where it would normally put the posts on the front page of your blog.

    Hope this helps,
    -drmike

  4. glaughton
    Member
    Posted 7 years ago #

    Thanks for the reply. I don't want WordPress to act as my Home page. I am trying to have a static Home Page with no posts, no loop - just my own design with a link to the blog.
    The new 2.1 feature would seem to be suitable, but I can't get it to work.

  5. glaughton
    Member
    Posted 7 years ago #

    Thanks drmike. I followed the instructions at http://codex.wordpress.org/Creating_a_Static_Front_Page and it says create the static page in root directory with a text editor, not via Dashboard.

  6. Chris_K
    Member
    Posted 7 years ago #

    Drmike was speaking of the new 2.1 feature, built-in now.

    You're looking at a document that pre-dates that feature.

    I reckon you'll want to pick one.

  7. glaughton
    Member
    Posted 7 years ago #

    Many thanks HandySolo & Mike et al - I mistakenly thought the document was about the new feature , not how it was done before!
    Yes I'll pick a method.

  8. willibrown
    Member
    Posted 7 years ago #

    I am having the same issue. This is an upgraded 2.05 to 2.1
    http://www.soulcode.net
    1. I have my special index.php at the root
    <?php
    /* Short and sweet */
    define('WP_USE_THEMES', true);
    require('./blog/wp-blog-header.php');
    ?>
    2. WP is installed in the folder /blog has
    3. I am using the new 2.1 feature Options/Reading/Front Page
    5. I have a page called Home with slug of home
    6. I even tried using a different page through the Options/Front Page feature and it didn't work
    7. I played with using the static_front page plugin - didn't work
    8. The Blog page works correctly

  9. willibrown
    Member
    Posted 7 years ago #

    Yeah farg! I did a fresh install on a different domain o' mine. http://www.moksha.net Worked like it s'posed to. Only difference? I'm running WordPress from the root with none of that fancy stuff where WP is installed in the folder /blog and my index.php is out to the root of my website. I THINK THAT'S THE ISSUE!!! BUT I'M NO GENIUS OR NOTHIN'

  10. willibrown
    Member
    Posted 7 years ago #

    Found a fix. I downloaded the Filosofo Home-Page Control and it ‘just worked’. I left its Home-Page Page option set at WordPress Default and its Blog directory option blank. This is rather strange behavior - a plugin which is telling WordPress to do what it is already configured to do that is, use a certain page as the index of my site and another “page” as the index of my blog.You can read the whole story of WordPress 2.1 in its Own Folder with a Static Front Page at the root here.

  11. GATEKeeper
    Member
    Posted 7 years ago #

    Is there a reason why WP would hide the Front Page display options? The first thing I see on the Reading Options page is the option to set the number of visible Blog Pages.

    I'm guessing it has something to do with me using an older template from a version before 2.1, but any ideas?

  12. richsipe
    Member
    Posted 7 years ago #

    I have written up a pretty simple howto I hope on setting up your static home page. You can find it here: http://www.richandstephsipe.com/wordpress/2007/02/12/wordpress-21-static-homepage/.

    My blog is setup with WordPress in a non root folder (mine is creatively named /wordpress/) and I have a pre 2.1 pretty standard template (although hacked to beyond recognition) setup and I had no issues.

    You shouldn't need an external plugin etc to enable this feature but if you had one active before the 2.1 release to hack the static home page feature you will need to undo this. Also if you have a home.php file I think you need to rename/blow it away because it causes issues.

    The biggest gotcha is you must "create" the new page to use as your static homepage using the WordPress-->Write-->Write Page Admin menu and NOT by creating a new .PHP page by hand and manually uploading it to your server. The old hack way to do the static page involved creating another page manually and then hacking it into place but WordPress 2.1 allows you to do this all within the WPAdmin manager without the Ugly Hacks.

    To make your new home page look different you will need to create a specific template with the design you want for your home page. Then you need to create (write in WordPress speak) a page using WordPress that you set to use that new template (mine has a blank Content section for that page). You also need to create another page in WordPress to use as your blog page since you now don't have that on your homepage and set that page to use your normal template. Anyways ... I don't want to rehash the longer writeup I did and end up confusing people more.

    GATEKeeper: If you don't see the "Front Page" option set as your first one your 2.1 update probably had some issues and you will need to redo it.

    If my blog write up isn't clear throw down a comment on the post and I will try to make it more clear.

    The issue I had and many others now are facing is the old hacky way to do it is getting mixed up into the new 2.1 way and confusing people. When you Google Static Home Page you get all the hacks and when you look it up on the WordPress support boards you get hacks mixed up with the now correct way to do it and it is hard to figure it all out.

  13. salumsden
    Member
    Posted 7 years ago #

    imetconsortium.com

    richsipe, your response and your tutorial via the link are helpful yet there is something you said that piqued my interest. "Also if you have a home.php file I think you need to rename/blow it away because it causes issues."

    pardon me if this has been answered/explained somewhere else: wordpress doesn't give me the opportunity to select the "home" page which is by default the root (did I get that right). I followed all the directions on wordpress and some tutorials--quite easy--but it ended up with pages: Home, About, Welcome (which I would like to be the static home page) and The Dispatch (the blog--which actually works). The issue being that both Home and Welcome go to the same spot (the root). Don't need them both but WordPress won't let me select "Home" as a page. I imagine this has something to do with what you said about blowing up the home.php file which I'd love to do but don't exactly know how.

    At this point I'd take either Home or Welcome as my Static page but not both.

    (Sorry if this is too novice for you pros but...)

  14. thirtyfour28
    Member
    Posted 6 years ago #

    Per the latest post by salumsden, does any one know how to complete that task? I am in the same situation having 2 home pages and would like just the one. Any help would be appreciated.

    Thanks!

  15. mstenzel
    Member
    Posted 6 years ago #

    thirtyfour28:
    I guessed and took out a line of code from the bottom of my theme's header file. My guess was based on the fact that it had "Home" as a link. It worked -- the WP-defaulted "Home" page disappeared. Here's the line of code I removed:

    <li><a href="<?php echo get_settings('home'); ?>/">Home</a></li>

    Then I made my own "Home" static page in Options|Reading and pointed and made that be my "Front page displays" target.
    Hope this helps.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.