Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm using a us/news/%postname%/ structure for my permalinks. This works great for regular posts.

However, I have a few different custom post types, and I don't want the us/news part in their slug.

How do I have it both ways?

share|improve this question
add comment

2 Answers

You could change your permalink structure to /%category%/%postname%/ and add the posts to a News category.

If you don't always want US in the URL, I suppose you could make a US category as a parent, then add the News category to it as a child. You'd have to duplicate for every country though. So you'd have to have UK -> News, then CA -> News, etc.

share|improve this answer
add comment

You can do this by setting 'with_front' => false while registering the new custom post type, To remove the custom post type slug which Wordpress adds by default, pass 'slug'=>'' empty.

E.g.

//Example - how to pass array to rewrite
$args = array(
    // This rewrite settings will remove the slug you want also the slug - /custom_post_type/
    'rewrite' => array('slug'=>'','with_front'=>false),
); 
register_post_type('custom_post_type',$args);

Reference - Register_post_type()

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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