Skip to main content
replaced http://wordpress.stackexchange.com/ with https://wordpress.stackexchange.com/
Source Link

I would use get_queried_object() (see this postsee this post) rather than $wp_query->query_vars

Also you should use $term->slug (and $category->slug) instead of $term->name.

Apart from that, your method is as good as any.

I would use get_queried_object() (see this post) rather than $wp_query->query_vars

Also you should use $term->slug (and $category->slug) instead of $term->name.

Apart from that, your method is as good as any.

I would use get_queried_object() (see this post) rather than $wp_query->query_vars

Also you should use $term->slug (and $category->slug) instead of $term->name.

Apart from that, your method is as good as any.

Source Link
Stephen Harris
  • 32.6k
  • 6
  • 84
  • 118

I would use get_queried_object() (see this post) rather than $wp_query->query_vars

Also you should use $term->slug (and $category->slug) instead of $term->name.

Apart from that, your method is as good as any.