Last active
October 17, 2015 02:40
-
-
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/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* 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' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* 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' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Unregister sidebars | |
unregister_sidebar( 'sidebar' ); | |
unregister_sidebar( 'sidebar-alt' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Unregister sidebars | |
// unregister_sidebar( 'sidebar' ); | |
unregister_sidebar( 'sidebar-alt' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//* Force full-width-content layout setting | |
add_filter( 'genesis_site_layout', '__genesis_return_full_width_content' ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.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