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:


which should correspond to:

(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

  • This topic was modified 4 days, 15 hours ago by darksid3.

Source link