Custom permalinks failing on 3.7
-
After upgrading to WP 3.7, my custom permalinks (defined in my functions.php file) ceased to work. Downgrading to 3.6.1 solved the problem.
I did the usual troubleshooting : disabled all plugins, refreshed the “Settings > Permalinks” page, clicked “Save Settings” on the “Settings > Permalinks” page, re-uploading my theme’s functions.php file. Nothing except downgrading worked.
For reference, here’s the relevant section in my functions.php file :
add_filter('generate_rewrite_rules', 'rp_rewrite_rules'); function rp_rewrite_rules($wp_rewrite) { $newRules = array(); $newRules['podcasts/(.*)/page/?([0-9]{1,})/?'] = 'index.php?category_name=$matches[1]&post_type=podcast&paged=$matches[2]'; $newRules['podcasts/(.*)/?'] = 'index.php?category_name=$matches[1]&post_type=podcast'; $wp_rewrite->rules = $newRules + $wp_rewrite->rules; }
The rules do the following :
https://example.com/podcasts -> shows all posts with post type “podcast”
https://example.com/podcasts/podcast-name -> shows posts of post type “podcast” from the “podcast-name” category
https://example.com/podcasts/podcast-name/page/2/ -> shows the 2nd page of results for posts of post type “podcast” for the “podcast-name” categoryNot sure what to do from here except avoid upgrading until I’ve seen other users with similar problems report that the issue is fixed.
- The topic ‘Custom permalinks failing on 3.7’ is closed to new replies.