I'm using underscores as the base for a theme and I can't figure out how to build custom pages templates.

I created a nosidebar.php and put this at its tope

<?php /* Template Name: WithoutSidebar */ ?>

It won't show on the page creation's dropdown, though. Only custom page I managed to make show there is front-page.php, which is already expected by WP's hierarchy.

I tried many solutions I found on Google (checking the root for style.css, etc) and none worked.

Can someone please shine a light over this?

I'm using WP 4.7.5

  • 1
    Where did you save this new page template? It must be in the active theme's directory structure.
    – jdm2112
    Jun 2, 2017 at 14:33
  • 1
    Also use the multiline format as the default themes do, for readability and to ensure that there are no quirks in parsing the header
    – Tom J Nowell
    Jun 2, 2017 at 14:50


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.