Help with rewriting category permalinks
-
Ok here goes. I’m writing a plugin that is partly built on Wp-Smart-Sort that is no longer being developed. Im writing a news site and would like to rewrite my URLs to support ordering posts depending on things like comment count.
Everything works fine and I can now use URLs like domain.com/sort/commentcount to get a list of posts ordered by the comment count. BUT this stops working when I move into the category pages. When I try to navigate to category/stuff/sort/commentcount I get redirected to category/stuff/ for some reason. Is there a gotcha or some reason this would happen? Im using wp_rewrite to accomplish this. Here are the rewrite rules from WP that have have to do with the category links:
With paging:
[category/(.+?)/sort/(.+?)/page/?([0-9]{1,})/?$] => index.php?category_name=$matches[1]&frettir=$matches[2]&paged=$matches[3]
Without:
[category/(.+?)/sort/(.+?)/?$] => index.php?category_name=$matches[1]&frettir=$matches[2]
Been battling this for 3 days now :/
The topic ‘Help with rewriting category permalinks’ is closed to new replies.