In page I have ID of term child, I need find out this child parent by child ID, it's passible, maybe someone can help with this ?
That's what the get_term
function is for:
$term_id = 21; // Lucky number :)
$child_term = get_term( $term_id, 'category' );
$parent_term = get_term( $child_term->parent, 'category' );
Replace 'category'
with whatever taxonomy you're using.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With