template pages vs default page.php / index.php
-
I’ve noticed something a little confusing about the way my site loads pages.
If i have a page that is a “category view”, for example if I set my hompage to be my latest posts, the browser window loads index.php (according to devtools).
If I load a “page”, that is set to the default template, it loads page.php.
However, if I set a page to a template other than default, the browser doesn’t load the template.php as I might have expected, it actually loads header.php – at least that’s what shows in the html in devtools, even though the template content does show in the browser below the header.
Normally, I wouldn’t worry about this as everything “looks” ok. However, I have custom js script which is in my header.php, but is addressing a css class in the content below the header, whether it is page.php, index.php or anything else – and it doesn’t work on template pages other than the default template.
Is this sort of thing “normal” for WP, or is it a specific issue with my theme i wonder?
- The topic ‘template pages vs default page.php / index.php’ is closed to new replies.