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

I've followed the official documentation to create my archives page:

It works fine exept that "is_archive() returns false when I'm viewing this page.

Any idea ?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

Because an "archives" Page is not an archive index of blog Posts, but rather a Page.

An "archives" page is simply a custom Page template, which applies to a static Page.

The is_archive() conditional returns true if an archive index is being displayed. An archive index page displays Posts, not static Pages.


Instead of using if ( is_archive() ), try using if ( is_page( 'archives' ) ) (assuming you've named your static Page Archives).

Alternately, you could use if ( is_page_template( 'archives.php' ) ) (assuming you've named your template file as archives.php).

share|improve this answer

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.