add_rewrite_rule() not working
-
I am trying to use add_rewrite_rule() to change this form of URL:
https://myserver/mysite/genre/advert/
(where “genre” is a custom taxonomy and “advert” is a taxonomy term.)to this:
https://myserver/mysite/search?_genres=advert
Here is what I’ve added to functions.php
function genre_rewrite_rule() {
add_rewrite_rule(‘^/genre/([^/]*)/?’, ‘/search?_genres=$matches[1]’, ‘top’);
}But No Joy.
Not sure what I’m doing wrong. Advice appreciated!
Mark
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘add_rewrite_rule() not working’ is closed to new replies.