New answers tagged add-rewrite-rule
Rules should be added on init because other code might flush rewrite rules, which would cause your rules to disappear.
Finally got this working nicely, this specific issue was just down to not flushing the rewrite rules (gets me everytime!) so it was fixed by simply navigating to the 'Permalinks' page in the WP admin area.
Well, apparently lots of trial and error pays off! I used this code instead, where I reversed my add_rewrite_rules and now it works perfectly. // Remember to flush the rules once manually after you added this code! add_rewrite_rule( // The regex to match the incoming URL 'our-work/our-year/([^/]*)/([^/]*)/([^/]*)/?', // The resulting internal ...
Top 50 recent answers are included