2

(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

1 Answer 1

3

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.