0

I have a theme, and I made two new files for different templates. I can now pick these templates when I post a page:

enter image description here

This works perfectly when I go to any subpage. I made a page called Test, selected one of my templates, and the page shows.

However, my challenge is this doesn't work for the home page.

I have now made my test page the index page:

enter image description here

However, when I open the page, it does not respect my selection. Instead, it will open the standard theme.

I guess it's caused by some challenge with the hierachy, but I don't completely understand why.

Any ideas? :-)

  • Do you want to make a subpage the home page ? – Beee Mar 19 '18 at 12:58
  • @Beee No, I want my home page to follow a specific template I have made. In practice, my home page will be a fully static HTML page i've made :-) This works fine with subpages, but not the home page – Lars Holdgaard Mar 19 '18 at 13:00
  • i'd look into what Jacob suggested. If it's not overriden by a default front-page.php (in the theme). – Beee Mar 19 '18 at 13:05
5

As you can see in the hierarchy flowchart on the page that you linked to, Site Front Page will choose front-page.php before falling back to behaving like a normal page:

enter image description here

So if you want to have a specific template for the front page template of your theme you need to make those changes to front-page.php, or delete front-page.php so that it behaves like a normal page.

  • 2
    Worked! Thanks! I'll make it an answer in 2 min when I am allowed :-) – Lars Holdgaard Mar 19 '18 at 13:09

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.