Using Blog Parent Slug on Blog Posts Only

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.