Skip to main content
added 143 characters in body
Source Link
metichi
  • 137
  • 5

I just found it out!

By using get_query_var ( 'cat' ) you get the value of the category in the query. So you can use cat_is_ancestor_of ( parent-cat-id, get_query_var ( 'cat' ) ) which will return true if you are looking at a child of a specific parent category. And from there you can modify your archive page to load whatever templates they need.

And regarding the issue of going to single page view, it had something to do with permalink. Setting them to "plain" made it work correctly

I just found it out!

By using get_query_var ( 'cat' ) you get the value of the category in the query. So you can use cat_is_ancestor_of ( parent-cat-id, get_query_var ( 'cat' ) ) which will return true if you are looking at a child of a specific parent category. And from there you can modify your archive page to load whatever templates they need.

I just found it out!

By using get_query_var ( 'cat' ) you get the value of the category in the query. So you can use cat_is_ancestor_of ( parent-cat-id, get_query_var ( 'cat' ) ) which will return true if you are looking at a child of a specific parent category. And from there you can modify your archive page to load whatever templates they need.

And regarding the issue of going to single page view, it had something to do with permalink. Setting them to "plain" made it work correctly

Source Link
metichi
  • 137
  • 5

I just found it out!

By using get_query_var ( 'cat' ) you get the value of the category in the query. So you can use cat_is_ancestor_of ( parent-cat-id, get_query_var ( 'cat' ) ) which will return true if you are looking at a child of a specific parent category. And from there you can modify your archive page to load whatever templates they need.