Can’t assign custom full width template to pages
-
Hi,
I want to create a full width page template with no sidebar. I use a child theme for twentysixteen.
I created a folder named “page-templates” in the child’s root and then created a file called “full-width-page-template.php” with the following code:<?php /** * Template Name : Full Width Page * *The template for displaying full width pages * * * @package WordPress * @subpackage Twenty_Sixteen * @since Twenty Sixteen 1.0 */ get_header(); ?> <div id="primary" class="full-width-page content-area"> <main id="main" class="site-main" role="main"> <?php // Start the loop. while ( have_posts() ) : the_post(); // Include the page content template. get_template_part( 'template-parts/content', 'page' ); // If comments are open or we have at least one comment, load up the comment template. if ( comments_open() || get_comments_number() ) { comments_template(); } // End of the loop. endwhile; ?> </main><!-- .site-main --> <?php get_sidebar( 'content-bottom' ); ?> </div><!-- .content-area --> <?php /*here there once was the function get sidebar*/?> <?php get_footer(); ?>
and the css related:
.full-width-page {
width: 100%;
}Meanwhile, in page edit screen in dashboard, no “Template” dropdown appears in page attributes. Also, in quick edit screen of a page i can only see the “Default template” option in “Template” dropdown.
Is there a way to make the Template dropdowns visible? If not, can I assign the template to specific pages using some code?
Thanks
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Can’t assign custom full width template to pages’ is closed to new replies.