[wp-hackers] Putting WordPress posts in different Permalink Structure, to Custom Post types

Robert Lusby nanogwp at gmail.com
Sun Feb 13 19:11:01 UTC 2011


Hello,

How do you set the rewrite slug of a standard WordPress post (but not affect
other Custom Post Types)?

In more detail:

We've been running an install of WordPress at http://www.example.com.

We use the "Post" function to run the news section of the site, therefore we
configured Peramlinks (in Settings) to use: /news/%postname%-%post_id%.

However we now have a custom post type called "events", we've set the
rewrite slug for this to be events: ['rewrite' => array('slug' =>
'webcasts')]

The problem being - the permalink setting is now causing URL's such as
http://www.example.com/news/events, when it should be
http://www.example.com/events.

Obviously removing /news/ from permalinks solves the problem, but then
leaves Posts without the /news/ sub-structure.

How do you set the rewrite slug of a standard WordPress post (but not affect
other Custom Post Types)?

Thanks,
Rob


More information about the wp-hackers mailing list