WordPress.org

Ready to get started?Download WordPress

Forums

Twenty Eleven
[closed] Create full-width page template (6 posts)

  1. slk182
    Member
    Posted 1 year ago #

    Help, please!
    I want to create a full-width page template that I can use for a static home page.
    I want to be able to adjust the white space around the text so that it displays in a narrower text body, centred, on this page.

    Following what I read in another thread, I:
    1. Opened the page.php file, copied it and renamed it: "Fullwidth page."
    2.Then I added this code to the top:

    <?php
    /*
    Template Name: Fullwidth page
    */
    ?>

    Here's where I'm stuck.
    What else do I put in this .php file?
    What I don't get is where/how I adjust the margins for this fullwidth page template I want to create.

    In my source page.php file, the existing code is:
    (Should I be coping a different .php file, not the "page" file?)

    get_header(); ?>
    
    		<div id="primary">
    			<div id="content" role="main">
    
    				<?php while ( have_posts() ) : the_post(); ?>
    
    					<?php get_template_part( 'content', 'page' ); ?>
    
    					<?php comments_template( '', true ); ?>
    
    				<?php endwhile; // end of the loop. ?>
    
    			</div><!-- #content -->
    		</div><!-- #primary -->
    
    <?php get_footer(); ?>

    Any help hugely appreciated. I'm on a very steep learning curve!

  2. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Width and margins are always set in the CSS code. Be very sure that you are using a Child Theme -- do not edit theme files in default themes.

  3. slk182
    Member
    Posted 1 year ago #

    YES! I am using a child theme.
    I have been adding customizations under:

    EDIT THEMES tab
    Click on "Stylesheet (style.css)"
    Putting blocks of customization code into this window, then clicking "Update File."

  4. WPyogi
    Volunteer Moderator
    Posted 1 year ago #

    Good - so that's where you can modify the width and margins there. Try using Firebug to determine the selectors you need to use to target that template.

  5. slk182
    Member
    Posted 1 year ago #

    Sorry... don't understand. I'm totally NEW to all of this.
    I thought I was supposed to create a new .php file in order to make a Fullwidth page template. So I opened a new .php file (which I've called "Fullwidth Page"), put in this code at the top:

    <?php
    /*
    Template Name: Fullwidth page
    */
    ?>

    And now I have NO IDEA what else I'm supposed to put in this .php file.

    I *thought* what I am trying to do is create a template, which will then show up as an option when I create a page, and I'll have the option to choose "Fullwidth page" which will be pre-formatted to the content width I want.

    But I don't know where to find the code to describe what I want on my Fullwidth page.
    I copied the code from the TwentyEleven page.php, but it doesn't seem to mention anything about margins:

    get_header(); ?>
    
    		<div id="primary">
    			<div id="content" role="main">
    
    				<?php while ( have_posts() ) : the_post(); ?>
    
    					<?php get_template_part( 'content', 'page' ); ?>
    
    					<?php comments_template( '', true ); ?>
    
    				<?php endwhile; // end of the loop. ?>
    
    			</div><!-- #content -->
    		</div><!-- #primary -->
    
    <?php get_footer(); ?>

    I need to get walked through this REAL slow. Things which may seem obvious to others are still unknown to me, have only been doing this for a few days.
    Thanks so much!!

  6. jkbaseer
    Member
    Posted 1 year ago #

    @slk182: Have you find the solution. If not reply me. I have found the solution after two days of struggle by reading 12 to 15 threads..
    thanks to wordpress moderators and communities..

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic