devoninternational
Member
Posted 1 year ago #
How can I add "blog/" to a URL only on blog posts?
For example:
http://www.domain.com/top-five-companies/
to
http://www.domain.com/blog/top-five-companies/
I ONLY want "blog/" added on single posts, similar to how you can rewrite URLs for custom post types (or maybe there is a simpler/better solution).
I've been looking quite some time for a solution, but to no avail. Thanks.
Go to Permalinks and select Custom. At the beginning type '/blog'.
devoninternational
Member
Posted 1 year ago #
Yes, but that will add "/blog" to ALL single items, including cutom post types, which I do not want to do. I just want to add "/blog" to the blog posts, since those are the only blog items.
devoninternational
Member
Posted 1 year ago #
Is there another way to add "/blog" to just the blog posts and not all single pages or static pages?
oddly enough this is not so easy. perhaps the best way to do it is to create a new custom post type called blog.
Perhaps a /%category%/%postname%/ in permalink settings, then assign posts to a category called "Blog" with a 'blog' slug.
http://codex.wordpress.org/Using_Permalinks
Using %category% with multiple categories on a post
When you assign multiple categories to a post, only one can show up in the permalink. This will be the lowest numbered category (see Manage Categories). The post will still be accessible through all the categories as normal.