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 want to prefix my blog posts with /news/ and changing my Permalinks to /news/%postname% seems to do the trick.

However, I also have a few custom post types and for some reason those URL's are now also prefixed with /news/. Of course this is not what I want.

How can I make sure that only the out-of-the-box Wordpress post type is prefixed with /news/?

share|improve this question
    
why don't you create a category called News to mark your posts, and set the links to /%category%/%postname% ???? –  andresmijares25 Nov 20 '11 at 5:41
    
Hmm. that seems to be a work around, albeit somewhat unclean. It's seems to be working though. Not sure yet how I feel about this solution in the long term. –  Luke Nov 20 '11 at 5:51

1 Answer 1

up vote 1 down vote accepted

Assuming that you are not using a plugin to handle your post types but are registering them manually:

Add the rewrite argument to your register_post_type() function calls.

$rewrite = array(
    'slug' => $slug,
    'with_front' => false
);

$args = array(
    // your other arguments
    'rewrite' => $rewrite
);

register_post_type( 'name_of_your_post_type', $args );

If your registering your post types with some plugin, check whether it has an option to set with_front to false. It defaults to true (unfortunately, for your sake).

Whether there's a plugin out there that has this feature I don't know - never used no post type plugin(s).

share|improve this answer
    
'with_front' => false was exactly what I was looking for. –  Luke Nov 20 '11 at 8:11

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.