how can i test if a wordpress taxonomy/term page is a child of another term? For instance, if i have a taxonomy for "portfolio-categories" which is hierarchical. my top level terms are "digital" and "print". under print, i have "television".. and a few others. if i am on the "television" archive, is_tax() is true as is is_tax('television') but not is_tax('print'). basically i'd like 'television' and its siblings to behave one way while the children of "digital" behave another.
is this possible or would this be best served by separate taxonomies?
In that page say archive-portfolio-categories.php or just archive.php .. I believe you can use the global variable $term to determine if you are on a child page. E.g.:
<?php
$term = get_term_by( 'slug', get_query_var( 'term' ) );
if($term->parent > 0)
{
// THIS IS A CHILD PAGE
// .. DO STUFF HERE..
}
else
{
// THIS IS THE PARENT PAGE
// .. DO OTHER STUFF HERE..
}
?>