WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to find a template page (or conditional statement) that will target:


but not


home.php and front-page.php seem to target both. The front page displays my latest posts.

Thanks in advance!

share|improve this question
up vote 0 down vote accepted

WordPress provides is_paged() which returns true on any archive or blog that stretches over multiple pages. This isn't what you want, but the is_paged Codex article tells us where to go:

If you need to check which page of the blog you are on, you can look in $wp_query->query_vars['paged']. Remember that inside functions you might have to global $wp_query first.

So, you should be able to use this snippet to only show something on the first page:

global $wp_query;
$my_paged_page = $wp_query->query_vars['paged'];
if ( $my_paged_page == 1 ) {
    // do something
share|improve this answer
Thanks for the tip! is_paged(); was exactly what I needed. – Andrew Carreiro May 27 '12 at 19:08
Great. Make sure to read the Codex as it seemed from your question that is_paged() would return TRUE on both the example URLs you listed. – mrwweb May 27 '12 at 19:13

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.