• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

HELP! Creating full width-page template WITHOUT sidebar

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › HELP! Creating full width-page template WITHOUT sidebar

This topic is: not resolved

Tagged: page template

  • This topic has 4 replies, 2 voices, and was last updated 10 years, 2 months ago by germandude.
Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • February 5, 2016 at 2:32 pm #178402
    germandude
    Member

    Hello everyone,

    I use the Lifestyle Pro-Theme for my website handgepaeckguide.de.

    I adjusted the function.php so that there is a full with header and a full
    width footer. The area between the header and footer is divided into a
    main content area and a sidebar.

    Now, I would like to create a page template where the area between the
    header and the footer has no sidebar and consists only of a (full width-)main content
    area.

    And I want to create a new CSS class to modify the width and other
    attributes of this main content area, (specifically for this page
    template).

    I understand, that I have to add a php-file to the Lifestyle Pro-Theme to
    create the page template.

    But even after reading numerous blog posts, I was not able to figure out
    what code this php-file exactly needs to contain to get the desired
    result.

    I managed to create a page template without sidebar. But I failed to include the CSS-classes which allow me to adjust the width and other attributes of the main content area.

    Can anyone help me out?

    Thank you very much in advance!

    Best regards from Germany,
    André

    http://handgepaeckguide.de/
    February 5, 2016 at 8:11 pm #178410
    Christoph
    Member

    Hallo André,

    you can include something like this code in your template:

     //* Add custom body class to the head
     add_filter( 'body_class', 'sp_body_class' );
     function sp_body_class( $classes ) {
     	$classes[] = 'standard';
     	return $classes;
     }

    Change 'standard' to whatever class you want to use.

    You can use this class as "prefix" to only target pages using that page template.
    e.g. .standard .entry-title


    https://www.christophherr.com | Genesis Customizations | Buy me a coffee

    February 6, 2016 at 12:31 pm #178471
    germandude
    Member

    Hello Christoph,

    thank you very much for your answer.

    The code snippet you provided me with does not exactly lead to the result that I wished for.

    The newly created class affects the attributes of the whole website, including the header, menu and footer.

    I aimed at creating a class that allows me to only change the attributes (particularly the width and padding) of the main content area between the main menu and the footer.

    I get the result I wished for, when putting this code in the page template-file:

    <?php
    /*
    * Template Name: Page without Sidebar
    */

    add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );
    }

    //loads the framework
    genesis();

    And by controlling the width of the page with a simple <div>-tag in the page-editor.

    It seems to work, but it would feel „cleaner“ if I created a class in the php template-file.

    Best regards,
    André

    February 6, 2016 at 12:37 pm #178473
    Christoph
    Member

    Hallo André,

    If you want to add a class to an element you can use the genesis_attr filter
    https://wpbeaches.com/adding-attribute-html-section-genesis/


    https://www.christophherr.com | Genesis Customizations | Buy me a coffee

    February 6, 2016 at 2:50 pm #178481
    germandude
    Member

    Hello Christoph,

    that worked perfectly, thank you very much!

    For everybody who is havin the same problem, this is the code of my page template:

    <?php
    /*
    * Template Name: Page without Sidebar
    */

    add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_full_width_content' );

    add_filter( 'genesis_attr_entry-content', 'themeprefix_add_css_attr' );
    function themeprefix_add_css_attr( $attributes ) {

    // add original plus extra CSS classes
    $attributes['class'] .= ' ohnesidebar';

    // return the attributes
    return $attributes;

    }

    //loads the framework
    genesis();

    Best regards,
    André

  • Author
    Posts
Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble