Changing permalink structures via WP_Rewrite
-
This is the first time I’m working with WP_Rewrite, I’ve studied Codex pages and some tutorials, but still missing the point. Any help would be much appreciated.
I’m building pretty complex site, it will have different sections, one of which – ‘News’ is native WordPress post type ‘post’ with native categories and tags, and other sections are custom post types with own custom taxonomies.
Here’s the URL structure I need:
example.com/– magazine-style home page, uses home.php theme template.
example.com/news/– default WP blog (built-in ‘post’ post type), list of all posts (index.php template)example.com/news/%category%/– (preferred) or
example.com/news/category/%category%/– category archiveexample.com/news/%category%/%postname%/– (preferred) or
example.com/news/category/%category%/%postname%/– single postexample.com/news/tag/%tag%/– tag archive (filter)And the same logic for custom post types, for example,
Eventswith own custom taxonomies – categories and types:example.com/events/– events archive (index)
example.com/events/%category%/– events category archive
example.com/events/%category%/%eventname%/– single event
example.com/events/%type%/– events type archive (filter)How can I achieve this?
The topic ‘Changing permalink structures via WP_Rewrite’ is closed to new replies.