?post_type=XXX not re-written
-
I have a Custom Post Type, setup using the plugin Types, called Publications.
Pretty permalinks are turned on, and have been re-saved to flush values.Simple version:
How do I rewrite /?post_type=XXX to /XXX/?Long version:
When viewing the archive page (archive-publications.php, calling loop-publications.php) the URL correctly re-writes to https://site.com/publications/
My problem is to do with combining years archives.
I have some code in functions.php (rewrite rules) to allow year archives to work – so https://site.com/publications/2013/ shows the posts correctly.
Likewise, https://site.com/?posts_type=publications&year=2013 shows the correct posts, however it rewrites to https://site.com/2013/?posts_type=publications
However https://site.com/publications/?year=2013 rewrites to https://site.com/2013/ and so shows all posts, not just the CPT.
Can you help me make this work “correctly”? I guess I need a new rewrite rule that deals with post_type= and gives it priority over the year rewrite, or something.
Thanks.
- The topic ‘?post_type=XXX not re-written’ is closed to new replies.