Possible Duplicate:
Check if current page is taxonomy term
For now, I use something like this to decide, if I'm on a taxonomy page.
if (arg(0) == 'taxonomy' && arg(1) == 'term' && is_numeric(arg(2))) {
$tid = intval(arg(2));
$parents = taxonomy_get_parents($tid);
$term = $parents[0];
...
}
Is there a more elegant way to decide, if I'm on a taxonomy page than this arg(0), arg(1), arg(2) thing?
Same would apply to a node page if (arg(0) == 'node' && is_numeric(arg(1)))
.
I didn't find any reference in the net. But maybe I ask the wrong questions.