I selected a page called "Actualités" in Dashboard > Settings > Reading > Posts page.

Wordpress does not use archive.php when I load this page, but index.php.

So I try to use is_archive() in index.php but it still returns false...

Am I doing something wrong? My sub-goal is to use this page as the archive page so my client can handle it in the menus.

  • have you looked at is_archive and the template hierarchy in codex? – Milo May 19 '15 at 16:18
  • I know the template hierachy and archive.php is the last choice for archives if the page is detected as it. My issue is that my page isn't detected as an archive page... – Sebastien May 19 '15 at 16:25
  • mh... Actually you're maybe right as Template Hierarchy doesnt mention the default behaviour for WP archives (only for post types), but I hoped that selecting my page as "Posts page" would consider it like an archive page. – Sebastien May 19 '15 at 16:31
  • Post page uses index.php or home.php. static front pages uses page templates. is_archive() will return false on the post page as this is your homepage – Pieter Goosen May 19 '15 at 17:42
  • In the Settings, I selected both: Static home page using a template, Posts page (which is not the same). – Sebastien May 20 '15 at 7:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.