Twenty Seventeen Full Width page template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body.page-template-template-full-width #content #primary { | |
max-width: 100%; | |
} | |
body.page-template-template-full-width #content #primary .entry-header, | |
body.page-template-template-full-width #content #primary .entry-content { | |
float: none; | |
width: 100%; | |
} | |
body.page-template-template-full-width #content #primary .entry-header { | |
margin-bottom: 4em; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Template Name: Full Width | |
* | |
* Description: A custom template for displaying a fullwidth layout with no sidebar. | |
* | |
* @package Twenty Seventeen Child | |
*/ | |
get_header(); ?> | |
<div class="wrap"> | |
<div id="primary" class="content-area"> | |
<main id="main" class="site-main" role="main"> | |
<?php | |
while ( have_posts() ) : the_post(); | |
get_template_part( 'template-parts/page/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(); | |
endif; | |
endwhile; // End of the loop. | |
?> | |
</main><!-- #main --> | |
</div><!-- #primary --> | |
</div><!-- .wrap --> | |
<?php get_footer(); |
Great, thanks!
But do you know how can I set ALL pages (homepage, categories, search results, etc.) as full-width?
I tried as told here https://themecoder.de/2017/04/12/full-width-page-template-fuer-twenty-seventeen-mit-wordpress-child-theme-erstellen/
But what I got are two rows with huge margins on the left and right. In the one row the title of the page. In the other the content. Basically nothing changed. What's wrong?
I copied the php content to the page.php of the child theme and the css to the styles.css.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks!
Would there be any other easy way to add the standard post template format (column + side bar on the right) to pages, as well? I've been trying but this is still a bit beyond me.
Edit: Never mind. Found the solution here: https://www.cssigniter.com/add-custom-page-template-using-child-theme/