Skip to content

Instantly share code, notes, and snippets.

@srikat
Last active October 17, 2015 02:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save srikat/f2766e43874bff1607ae to your computer and use it in GitHub Desktop.
Save srikat/f2766e43874bff1607ae to your computer and use it in GitHub Desktop.
How to add a right sidebar for Posts and Pages in Whitespace Pro. https://sridharkatakam.com/how-to-add-a-right-sidebar-for-posts-and-pages-in-whitespace-pro/
//* Unregister layout settings
genesis_unregister_layout( 'content-sidebar' );
genesis_unregister_layout( 'sidebar-content' );
genesis_unregister_layout( 'content-sidebar-sidebar' );
genesis_unregister_layout( 'sidebar-sidebar-content' );
genesis_unregister_layout( 'sidebar-content-sidebar' );
//* Unregister layout settings
// genesis_unregister_layout( 'content-sidebar' );
genesis_unregister_layout( 'sidebar-content' );
genesis_unregister_layout( 'content-sidebar-sidebar' );
genesis_unregister_layout( 'sidebar-sidebar-content' );
genesis_unregister_layout( 'sidebar-content-sidebar' );
//* Unregister sidebars
unregister_sidebar( 'sidebar' );
unregister_sidebar( 'sidebar-alt' );
//* Unregister sidebars
// unregister_sidebar( 'sidebar' );
unregister_sidebar( 'sidebar-alt' );
//* Force full-width-content layout setting
add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' );
// Force content-sidebar layout setting to all singular pages
add_action( 'get_header', 'sk_force_layout' );
function sk_force_layout() {
if ( ! is_singular() ) {
return;
}
// Force content-sidebar layout setting
add_filter( 'genesis_pre_get_option_site_layout', '__genesis_return_content_sidebar' );
}
.content-sidebar .content {
float: left;
width: 70%;
}
.sidebar-primary {
background: #eee;
float: right;
width: 30%;
padding: 100px 0;
border-left: 1px solid #e2e2e2;
}
.sidebar-primary .widget {
padding: 0 40px;
}
.sidebar-primary h4.widgettitle {
color: #333;
font-size: 28px;
}
.content-sidebar-wrap {
overflow: hidden;
}
.content-sidebar-wrap .content,
.content-sidebar-wrap .sidebar {
margin-bottom: -99999px;
padding-bottom: 99999px;
}
@media only screen and (max-width: 960px) {
.content-sidebar .content,
.sidebar-primary {
width: 100%;
float: none;
}
.content-sidebar-wrap .content,
.content-sidebar-wrap .sidebar {
margin-bottom: 0;
padding-bottom: 0;
}
.content-sidebar-wrap .sidebar {
padding: 60px 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment