Rewriting urls for subcategories in wordpress -


i have problem rewriting urls in wordpress page.

add_rewrite_rule( '([^/]+)/popular', 'index.php?category_name=$matches[1]&popular=yes', 'top' ); 

it works fine 1 category

but have subcategories , doesn't work:

add_rewrite_rule( '([^/]+)/popular', 'index.php?category_name=$matches[1]/$matches[2]&popular=yes', 'top' ); 

should change sth in line?

regards


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -