problems with default rewrite rules in wordpress
-
first sorry for the english, it is not my language.
I recently had problems with pagination in the query, and I discovered that the problem was in the wordpress rewrite rule that did not direct correctly due to an excerpt:
“genero/([^/]+)/page/?([0-9]{1,})/?$”,
which should correspond to:
“index.php?genre=$matches[1]&paged=$matches[2]”
(I was able to access normally),after some time I managed to make it work by removing the expression and adding another rule without the excerpt : “{1,}”, what I would like to know is if this snippet is some kind of bug because all the custom types with this snippet are having problems, or if it is an error in my code
follow my solution:
add_rewrite_rule( 'genero/([^/]+)/page/?([0-9])/?$', 'index.php?genre=$matches[1]&page=$matches[2]', 'top' );
notice, I took the opportunity to replace the query var “paged” with “page”, but I tried to search for “paged” before adding this rule
again sorry if it’s a big mess of mine, i’m new to it and if you need more information just let me know i’ll try to answer as soon as possible
I had also tried to flush the rules and change to /% postname% / in the permalinks
- The topic ‘problems with default rewrite rules in wordpress’ is closed to new replies.