I want to get_queried_object of parent to see does he have any parents. How can i get it?
I think that it should be something like this
$parent_id_of_current_category->get_queried_object()->parent;
I want to get_queried_object of parent to see does he have any parents. How can i get it?
I think that it should be something like this
$parent_id_of_current_category->get_queried_object()->parent;
2
Answers
Here is the solution, to get all parent of post/taxonomy/page and so on. Just replace 'product_cat' with what you need
Use
get_term_by
: