the blog of alicia weller
Random header image... Refresh for more!

Create a faux blog directory in WordPress

This is a useful tip I discovered through experimentation some time ago. As I was answering someone’s question about how to do this in the WordPress.org support forums the other day as a much simpler solution than a second WP installation, it occurred to me that I should write this post. My impression is that it might not be a widely known tactic.

For people who want to use WordPress to manage their “regular” website, it is common to set the permalinks to:

/%postname%/

The above gives the result: domain.com/page-name which is perfect for simple websites if they only have pages.

When using WordPress to manage a website and blog all in one installation, it can be important to be able to have a blog that appears to live in a sub-directory of /blog/ or something similar so posts appear to live at a different level than pages. Plus, the appearance of a blog directory may be more desirable than the year or year and date based urls for blog posts. (not that you couldn’t have both)

To create a faux sub-directory for your blog, all you need to do is take the name of your blog page whether it’s “blog” or “news” and plug it in to the custom permalink field like:

/blog/%postname%/

Only single entries are shown as domain.com/blog/post-name. Pages still show as domain.com/page-name, and since your blog page is already domain.com/blog; whenever a user browses to a single entry, it appears to be in the same sub-directory as the blog or news…or whatever you choose.

Hopefully some of the people who need this information stumble across it before they go doing something crazy like adding a second WP installation to solve this problem. :)

0 comments

There are no comments yet...

Kick things off by filling out the form below.

Leave a Comment

Powered by WP Hashcash