Question

Right, please excuse the stupid question.

On my new blog I want the home page to be the "home" page I've created, and not the list of articles... that's fine, I go to Settings -> Reading -> Front page displays and change Front page to Home.

But now I want /blog/ to list my articles, however I get a 404 :S

I'm a bit stuck on this one, any help would be mucho appreciated.

Was it helpful?

Solution

This depends on how the index.php of your theme is coded. If it is a standard blog index page (as it is in 2010), all you need to do is:

  1. create a page named "blog" (or whatever you fancy), no need to add any content or select any template,
  2. in wp-dashboard > Settings > Reading:
    • tick "static front page"
    • select your "home" page as the Front Page
    • select the "blog" page you created as the Posts Page,

again, it depends on the default index.php of your WordPress theme.

It may also help to regenerate the permalinks, go to wp-dashbaord > Settings > Permalinks and click "save changes" (no need to change anything). Watch for any warning messages on updating .htaccess (and update manually if required), then check again.

OTHER TIPS

You need to edit "index.php" in your theme directory (wp-content/themes/your-theme/index.php), this will display all of your excerpts etc.

So, you want your homepage to display intro text and then have a seperate page to display blog posts.

Probably the easiest way I would do this is create a category called blog. Add it to the menu (new in WP3) and make sure you have category.php in your theme files to display excerpts of your blog posts.

The way we do this is to have a page template called template-blog.php and then create a page called "Blog" within the admin area. This way you still get WYSIWYG control over some simple elements like slug etc. Then simply select the template-blog from the drop list under "Template".

Within your template-blog.php place all your loop code etc etc in this file. Now within your admin panel you can select multiple categories and you can use the category.php templates to control how they are displayed.

This is a little tricky to explain. Go carefully over Settings Reading SubPanel and Creating a Static Front Page in Codex.

Basically when you set static Front page your index of posts gets pushed to nowhere. Then you can optionally create page and assign it to Posts page that will act as blog root previously acted.

On the deeper level such page will follow is_home template path in Template Hierarchy instead of regular is_page.

If I am not missing anything creating page with slug blog and assigning it to Posts page will get you what you want and that page will be controlled by template home.php (if present) or index.php (effectively site root).

This is what I did:

  1. Create a php file called blog.php (this is your blog template)
  2. Create a page called "Blog" or "My Blog", whatever you want to call it and assign the blog template to this page.
  3. Add the Blog page to the main menu
  4. Select the Blog page as posts page.
  5. Regenerate permalink.
Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top