Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

WordPress WordPress Theme Development Building Page Templates in WordPress Creating Custom Page Templates in WordPress

Tamami Hillerman
Tamami Hillerman
8,738 Points

Template option does not show up.

In the video, when Zac is on the contact page, there is a template dropdown option to choose between "Default Template" and "Left Sidebar" within Page Attribute section. When I am on the page, there is no template dropdown option, just "parent" and "order". What am I doing wrong?

Here is my code:

<?php 
/*
    Template Name: Left Sidebar
*/
?>
<?php get_header(); ?>


 <section class="two-column row no-max pad">
      <div class="small-12 columns">
        <div class="row">
          <!-- Primary Column -->
          <div class="small-12 medium-7 medium-offset-1 medium-push-4 columns">
            <div class="primary">

                <?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>

                  <h1><?php the_title(); ?></h1>
                  <p><?php the_content(); ?></p>

                <?php endwhile; else : ?>

                  <p><?php _e( 'Sorry, no pages found' ); ?></p>

                <?php endif; ?>

            </div>
          </div>

<!-- Secondary Column -->
        <div class="small-12 medium-4 medium-pull-8 columns">
          <div class="secondary">
            <h2 class="module-heading">Sidebar</h2>     
          </div>
        </div>
     </div>
    </div>      
</section>

<?php get_footer(); ?>
jason chan
jason chan
31,009 Points

I fixed your formatting.

Tamami Hillerman
Tamami Hillerman
8,738 Points

Thank you, Jason! I have never asked questions here before, and I was wondering why mine was showing up weird.

I was getting the same problem until I realized I have to give the template a name in the comments part.

5 Answers

Did you save the file as page-sidebar-left.php instead of page.php?

lu joseph
lu joseph
5,440 Points

Hi, i have the same problem. When i open up my contact page in admin panel the template option is missing the code is same the one on above

could any one help me?

Jonathan Allen
Jonathan Allen
6,736 Points

I had the same problem until I saw that in my page-sidebar-left.php file, in the comment where I was supposed to have "Template Name: Left Sidebar" I had misspelled it "Templante".

Might want to look for small errors like that.

Kiril Christov
Kiril Christov
9,208 Points

Me too. Same problem. I don't have page templates attribute.

Aurore PAVAN
Aurore PAVAN
4,307 Points

Hi, I had the same problem, and you shouldn't put a space in front of the":" which gives this: /* Template Name: Left Sidebar */