Isolate parent and child terms

Question

Is there a simple way to get the parent and child terms isolated in a variable on a custom post?

Right now the taxonomy hierarchy looks like:
– Country (parent)
– City (child)

What I want is to get the parent term in a $parent and child in $child variable.

--------------------------------------------------

>>> Share a link to this question, just copy and paste the code bellow on your web page <<<

<a href="https://www.wptricks.com/question/isolate-parent-and-child-terms/">

Isolate parent and child terms</a>
0
, , Young Grashopper 9 months 0 Answers 45 views 0

Leave an answer