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

Brandon Powell
Brandon Powell
663 Points

Custom Page Templates Not Displaying In Dropdown

up vote 0 down vote favorite I'm working on a One-Page custom Wordpress theme him having some problem in the Backend of the WordPress. When every I make a Custom Page Template in my directory does not show up in dropdown I have added everything and save everything right insides the code.

This how him loading all the custom pages, header, and footer to load on front-page.

<div id="primary" class="content-area"> <main id="main" class="site-main" role="main">

        <?php while (have_posts()) : the_post(); ?>
            <?php get_template_part('templates/page', 'header'); ?>
            <?php get_template_part('templates/modules/content', 'page-about'); ?>
            <?php get_template_part('templates/modules/content', 'page-services'); ?>
            <?php get_template_part('templates/modules/content', 'page-photography'); ?>
            <?php get_template_part('templates/modules/content', 'page-portfolio'); ?>
            <?php get_template_part('templates/modules/content', 'page-contact'); ?>
            <?php get_template_part('templates/page', 'footer'); ?>
        <?php endwhile; ?>

</main><!-- #main -->

</div><!-- #primary --> Here are some screenshot of directory of custom pages that trying to load inside my dropdown template.

Page 1 https://gyazo.com/b5cb0349b68c9819cf4632b238201259 Page 2 https://gyazo.com/88baa34089370362c77edc2b67f12617 Page 3 https://gyazo.com/12f204187c92c7f2ec380845ee2490dc Page 4 https://gyazo.com/2b05906194a6e4ee7c0eacf5d19b7bef Page 5 https://gyazo.com/af8f59a00c68008eb833d8420a38961f Backend https://gyazo.com/455f44b60d102856ea56cf2ad00adbb4

1 Answer

Taking a stab in the dark here but have you defined your template name?

Example:

<?php
/*
Template Name: Example
*/
?>
Brandon Powell
Brandon Powell
663 Points

Yes I have defined every with Template Name currently