Check if current page is taxonomy term How can I check if the current page is a taxonomy term page, similarly to what done with the following code used to check if the current page is the front page?

if (drupal_is_front_page()) {
  // The current page is the front page.
}
else {
  // It is not the front page.
}
Just to offer a solution that doesn't make use of arg() (which it's advised to avoid where possible according to the docs page)

You can use the menu_get_object() function:

$term = menu_get_object('taxonomy_term', 2);
if ($term) {
  // User is on a taxonomy term page
}