Returns whether the current page is the page of the passed-in term.
Drupal\taxonomy\Term $term: A taxonomy term entity.
function taxonomy_term_is_page(Term $term) {
$page_term = menu_get_object('taxonomy_term', 2);
return !empty($page_term) ? $page_term->tid == $term->tid : FALSE;
}