I’m having a little trouble understanding why my template is not working. I’m trying to create a jumbotron element specific to each page.
I’ve got base-template-test.php which is a copy of base.php. Then I’ve got in the root folder of my theme base-page-about.php and page-about.php. I’ve also got a templates/page-about.php.
If I select Default template in wordpress dashboard when creating a page, I get a page with the contents from page-about.php. But If I select custom template, I only get the base page.
The template hierarchy will automatically load
page-about.php for a page named about. The wrapper will automatically load
page-about.php is being used.
Because you are manually selecting a custom template (
template-custom.php perhaps?) the template hierarchy ignores
page-about.php and the wrapper will not know to load
Instead the wrapper will try to load
In short, the wrapper takes the file loaded by WordPress and looks for a template with
I was in a bit of a rush when I wrote the above post. I’m used to templating languages from python (like jinja2) and wordpress is pretty much new territory for me. I’m not entirely sure what sort of content I should have in
base-page-about.php. There’s only the html for a jumbotron in that file.
Right now, by selecting the default template from dashboard, my about page is an unstyled page with only the raw html. There’s nothing from
Have you read about the template hierarchy and my introduction to the wrapper?
It may help you better understand what and why things go where.