• There’s a long article on customizing twenty seventeen which is very useful, but it’s older and the author isn’t responding to questions any more. So I’m hoping somebody here can clarify something for me.

    I want to create a full-width page template as currently the pages look lopsided (see for example here). What I’ve done:

    –Copied the twenty seventeen page.php to my twenty seventeen child theme
    –Renamed it page-full0width.php
    –Changed the first line to * Template Name: Full Width

    Then the instructions say to add this:

    <div class="wrap page-full-width">

    “to the wrap driv”

    Question: Can I assume he meant wrap div? And even if I assume that, I’m unclear on where exactly this div class goes in the code. The code is below.

    Question: Where do I put

    <div class="wrap page-full-width">

    in the following?

    get_header(); ?>
    <div id="primary" class="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 get_sidebar(); ?>
    <?php get_footer(); ?>

    I realize there is still fiddling to do with css, etc., but I have to pass this hurdle first.

    Many thanks for your help.

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter rosina lippi

    (@greenery)

    typo: it should read page-full-width.php

    Donna Fontenot

    (@cavalierlife)

    Yes it means the wrap div, and it’s probably in a different file; in this case, probably in template-parts/content.php . I haven’t looked there, but that would be my guess.

    Thread Starter rosina lippi

    (@greenery)

    Thanks so much. I’ll have a look.

    Michael

    (@alchymyth)

    Question: Where do I put…

    if you look at the original page.php https://themes.svn.wordpress.org/twentyseventeen/1.2/page.php of Twenty Seventeen, there is the <div class="wrap"> directly after the ‘get_header()’ line…

    Thread Starter rosina lippi

    (@greenery)

    Michael — here’s an embarrassing confession: I took page.php from twenty sixteen instead of twenty seventeen by mistake. Now I’ve got the right php file. And another question.

    does <div class="wrap page-full-width">

    come before, after, or does it replace

    <div class="wrap">

    ?

    Michael

    (@alchymyth)

    it replaces…

    Thread Starter rosina lippi

    (@greenery)

    Thank you.

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘full-width page template’ is closed to new replies.