(Advanced warning: novice question)

I’m trying to find a way to add a blog slug to any blogs I post. Example:

mysite.com/theblog/aparticualrblogpost

mysite.com/theblog/anotherblogpost

Any page created that isn’t a blog should use the standard structure:
mysite.com/agenericpage
mysite.com/parentpage/anothergenericchildpage

How can this be achieved?

1 Answer
1

Just set your custom permalink structure to:

/theblog/%postname%/

If you have any custom post types used on your site, you’ll need to make sure that they don’t get the /theblog/ prepended to their URLs. To remove it, simply set with_front to false where the custom post types are registered:

'rewrite' => array('slug' => 'portfolio', 'with_front' => false),

You also need to flush the WordPress rewrite rules after making this change – just go back to Settings > Permalinks save again the permalink.

You are done.

Leave a Reply

Your email address will not be published. Required fields are marked *