A client wants certain posts to have a custom permalink structure. Client is running WordPress 2.8.5 and upgrade is not currently an option, so I can’t use a custom post type. That being the case, it seems I must use a category to create the custom structure.
So, I need the site-wide structure http://example.com/%post_id%/%postname%/
to turn into http://example.com/%postname%/
just for posts in the one category.
I gather that I need to use add_rewrite_rule
to change the permalink. But I’m having trouble changing the URL structure at all adding rules to functions.php
, and I don’t understand regex well. Can I filter for a generic structure such as %post_id%
, or only strings? Can anyone provide some guidance as to how I may accomplish this goal?