0

I believe these are the common filters to use when overriding a template

  1. template_include
  2. single_template
  3. page_template
  4. archive_template

The works but it seem that they are theme depended. I am using a theme called hello elementor from WordPress it is calling index.php as a blog archive template. So i tried to override that with archive_template but it does not work. I tried template_include which works but it overrides other templates of single and page templates also.

is_archive() returns

enter image description here

If the theme had archive.php I belive archive_template would have worked. So what's the method I should go for to make it work with all themes?

  • 1
    "If the theme had archive.php I belive archive_template would have worked." False. Conditional tags like is_archive() have nothing to do with what templates are used. – Jacob Peattie Aug 13 '19 at 0:25
  • @JacobPeattie thanks. What if the archive.php does not exist? – Latheesh V M Villa Aug 13 '19 at 9:40

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.