• I’m a relative novice and wish to find a way to optionally disable the RH sidebar for the static page setup thus using the entire page width for the main body of the page content.

    Is this possible with relative ease?

    I found a post that suggested using a custom field for V3.x but this doesn’t seem to work in 4.4.2 using twenty sixteen.

    Comments would be appreciated.

Viewing 8 replies - 1 through 8 (of 8 total)
  • if this page is your home page then use appearance>customization and most likely set to post layout.

    if not then when editing the page directly it should offer a drop down menu on the right or under the editor to switch from r-sidebar | l-sidebar | fullwidth

    unfortunately, Twenty Sixteen has neither a ‘full width’ page template nor the options to set the sidebar position.

    however, if no widgets are set into the ‘sidebar’ section, the content will automatically expand, so you could use a plugin to have the widgets conditional for the page (for example, ‘jetpack’ has a ‘widget visibility’ module).

    or
    you can create a ‘full width’ page template in a child theme;
    or
    you can create a code based on custom fields to remove the sidebar condional on some pages;

    if no widgets are set into the ‘sidebar’ section, the content will automatically expand,

    did not know this, thank you

    if no widgets are set into the ‘sidebar’ section, the content will automatically expand,

    just a note: this is theme specific, and not a general behaviour.

    noted

    correction:
    the Twenty Sixteen theme automatically centers when the sidebar area is without widgets – but the center does not expand.

    this would require some added CSS, like:

    @media screen and (min-width: 56.875em) {
    
    	/*no sidebar expand center*/
    
    	.no-sidebar .content-area
    	{
    	  float: left;
    	  margin-right: -100%;
    	  width: 100%;
    	}
    	.no-sidebar .site-content
    	{
    	  padding: 0px;
    	}
    	.no-sidebar .entry-header, .no-sidebar .entry-content, .no-sidebar .entry-summary, .no-sidebar .entry-footer, .no-sidebar .comments-area, .no-sidebar .image-navigation, .no-sidebar .post-navigation, .no-sidebar .pagination, .no-sidebar .page-header, .no-sidebar .page-content, .no-sidebar .content-bottom-widgets
    	{
    	  margin-right: 5%;
    	  margin-left: 5%;
    	}
    	body.no-sidebar:not(.search-results) article:not(.type-page) .entry-content
    	{
    	  margin-left: 25%;
    	  width: 70%;
    	}
    	body.no-sidebar:not(.search-results) article:not(.type-page) .entry-footer
    	{
    	  margin-left: 5%;
    	}
    }
    Thread Starter dp34067

    (@dp34067)

    I have added your suggested code to style.css in the child directory but it doesn’t appear to have had any effect: –

    /*
    Theme Name: Twenty Sixteen Child
    Description: Twenty Sixteen Child Theme
    Author: DJP
    Version: 1.0
    Template: twentysixteen
    */
    
    @import url('../twentysixteen/style.css');
    
    #secondary {
        display: none;
    }
    
    @media screen and (min-width: 56.875em) {
    
    	/*no sidebar expand center*/
    
    	.no-sidebar .content-area
    	{
    	  float: left;
    	  margin-right: -100%;
    	  width: 100%;
    	}
    	.no-sidebar .site-content
    	{
    	  padding: 0px;
    	}
    	.no-sidebar .entry-header, .no-sidebar .entry-content, .no-sidebar .entry-summary, .no-sidebar .entry-footer, .no-sidebar .comments-area, .no-sidebar .image-navigation, .no-sidebar .post-navigation, .no-sidebar .pagination, .no-sidebar .page-header, .no-sidebar .page-content, .no-sidebar .content-bottom-widgets
    	{
    	  margin-right: 5%;
    	  margin-left: 5%;
    	}
    	body.no-sidebar:not(.search-results) article:not(.type-page) .entry-content
    	{
    	  margin-left: 25%;
    	  width: 70%;
    	}
    	body.no-sidebar:not(.search-results) article:not(.type-page) .entry-footer
    	{
    	  margin-left: 5%;
    	}
    }

    Am I overlooking something?

    hmmm try without spaces
    .no-sidebar.content-area

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Using a Custom Field with static front page to disable RH sidebar in twenty sixt’ is closed to new replies.