Last updated August 23, 2009. Created on December 4, 2005.
Edited by SLIU, Jeff Burnz, add1sun, ksenzee. Log in to edit this page.

If you plan to use the $page or $is_front variables in a conditional statement here is a good thread (especially read the comments) that discusses the difference between the two variables.

Simply put $is_front is set only when you are on the front page of the site. The $is_front variable is not set for "listing" pages, e.g. if you click on a taxonomy term and get a listing of nodes classified under that taxonomy term.

$page is equal to 0 for all "listing" pages such as taxonomy term pages.

Code Examples

<?php if ($is_front): ?>
  <p>This will only appear on the front page.</p>
<?php endif; ?>
<?php if ($page == 0): ?>
  <p>This will appear on listing type pages.</p>
<?php endif; ?>

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.