0

I'm using this Rewrite Rules Inspector plugin to see my rewrite rules if there is any wrong in my code and i have one :

add_rewrite_rule(
    '/?([^/]+(?<!categories))/([^/]+)/?$',//preg_quote('/?([^/]+(?<!categories))/([^/]+)/?$')
    'index.php?list-item=$matches[2]&post_type=list-item',
    'top'
);

I have two questions :

1- This code works well with all content types that i have put doesn't work with category page it gives me error ** preg_match() [function.preg-match]: Unknown modifier 'c' **

2- How to change the category page to get from custom content type not from post type.

Ahmed Saber
  • 489
  • 1
  • 9
  • 21
  • Your first question is easy, you need to escape the forward slashes or change the delimiters. Your second one is unclear and you don't show how you tried to solve it. – HamZa Aug 09 '13 at 14:57
  • @HamZa the second one i added this code in the category.php `query_vars, array( 'post_type' => 'list' ) ); query_posts( $args ); ?>` – Ahmed Saber Aug 10 '13 at 12:29
  • I still have the same error here is reg that i'm using `\/(?!category)[^\/]+\/([^\/]+\/?){1}$` work's fine outside Wordpress why it doesn't work with add_rewrite_rule function i don't know ? – Ahmed Saber Aug 10 '13 at 16:11
  • What error do you get ? Also you should know that 99.999999% of your problems has already occured many times and that there is already a solution for it. Have you searched the error ? Have you followed a tutorial on how to do what you want or are you just trying ... ? – HamZa Aug 10 '13 at 16:45
  • that the error i get `Warning: preg_match() [function.preg-match]: Unknown modifier 'c' in C:\wamp\www\ProjectLap\wp-content\plugins\rewrite-rules-inspector\rewrite-rules-inspector.php on line 165` and yes i searched about this problem and they all that i have to escape the special chars and i did put when i do that the code doesn't work at all – Ahmed Saber Aug 10 '13 at 18:43
  • Can you please enter [the regex chatroom](http://chat.stackoverflow.com/rooms/25767) ? – HamZa Aug 10 '13 at 18:55

0 Answers0