Here's my scenario:
- I'm using
<body>tag as per the Codex instructions
I've created specialized page templates (as described here) for the following pages:
The page templates themselves load just fine.
- The problem begins with the classes being returned by
body_class(): for the first two pages it works fine, returning
.page-template-page-services-phprespectively. For the other two pages it just returns
.page-template-default, despite the fact that it is clearly not using the default page templates.
Does anyone know what might be causing this?
I know several ways of forcing it to add the classes, so I'm not looking for a workaround. I'm just wondering why this functionality doesn't seem to work correctly out-of-the-box.
UPDATE: Having poked around the
body_class() function I've narrowed down the cause; it seems the page templates for those two pages hadn't been saved to the post meta table. The next question is what may have caused this.