Wordpress static homepage

4 replies
For majority of my sites, I want to install Wordpress into "blog" folder.

domain.com/blog/

Currently, I am showing Wordpress on the homepage domain.com/index.php using the below as index.php

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

But with this method, both domain.com/index.php and domain.com/blog are showing duplicate content.

I want a static page on domain.com/index.php with the same wordpress theme and no changes to domain.com/blog showing the latest posts. This way I can use the homepage as a landing page and the blog for articles.

I came across a method. But it requires installing Wordpress at root, which I don't want to, and using Permalinks to set the blog url.

I know a simple way is just to create a html page and use it as the index.php but I am trying to find out if I can do it in Wordpress.
#homepage #static #wordpress
  • Profile picture of the author Tony Hetherington
    Here's how to set up a static homepage in Wordpress... Taken from my WSO

    The first step is to create a page that will be your new home page.
    1. In your WordPress control panel, select the Pages tab.
    2. Click on Add New.
    3. Give the page a title, "New Home Page."
    4. Create the content for your home page just as you would a blog post.
    5. Click the Publish button.
    While you're still in the Write Page subpanel, create a second page:
    1. Title this one "Latest News" (or whatever you want to call the page that your recent posts will appear on).
    2. You don't need to create any Page Content for this one as your posts will appear here. In fact the new posts will overwrite anything you put here.
    3. Click the Publish button.
    Now you're ready tell WordPress to use your new page as the home page:
    1. In the Settings panel on the left navigation select Reading.
    2. At the top of the Reading Options subpanel you'll see:"To change the front page to your new home page, select "A static page" for Front page displays.
    3. Select "New Home Page" from the Front page drop down menu.
    4. Finally, be sure to tell WordPress which page to use to display your recent posts. From the Posts page menu select the "Latest News" page you created earlier.
    5. Click Save Changes.
    6. View your site. "New Home Page" should now be your home page.

    Hope that helps

    Tony
    {{ DiscussionBoard.errors[1847273].message }}
  • Profile picture of the author rosetrees
    Originally Posted by Success View Post

    But it requires installing Wordpress at root, which I don't want to, and using Permalinks to set the blog url.
    .
    I would say there are two ways of doing this.

    One, as Launchworkshop desicribed, is to set a static homepage as your landing page and then to set up a "page" called blog to use for your blog posts.

    This, though, uses the permalinks.

    The second way would be to do another installation of wordpress on yourdomain.com/blog

    This would be totally separate from your landing page. You could use the same theme or a different one and there would be no connection between the two.
    {{ DiscussionBoard.errors[1847293].message }}
  • Profile picture of the author Success
    Thanks Tony, I know these steps. But as shared in my first post, this method only works if you want a static page plus posts page in the same directory level, or installing WP in root and using permalinks to make them different.

    What I want is the WP files installed in /blog/ with no changes to the WP index page on domain.com/blog/ but I want to have a static page with the same WP theme design on domain.com/index.php

    I know it can be easily done with a html file by copying the WP theme. But I want to find out if it's possible to do it via WP interface.
    Signature

    .

    {{ DiscussionBoard.errors[1847299].message }}

Trending Topics