Skip to content

Instantly share code, notes, and snippets.

@srikat
Last active December 30, 2015 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save srikat/7888764 to your computer and use it in GitHub Desktop.
Save srikat/7888764 to your computer and use it in GitHub Desktop.
Equal heights for Content and Primary Sidebar (with Content-Sidebar as the default layout in Genesis settings) in Magazine Pro and placing a vertical separator line between them. http://sridharkatakam.com/adding-vertical-separator-lines-content-sidebars-magazine-pro/#comment-1264
// Enqueuing Equal heights jQuery for Content and Primary Sidebar (with Content-Sidebar as the default layout in Genesis settings)
add_action( 'wp_enqueue_scripts', 'sk_equal_heights' );
function sk_equal_heights() {
wp_enqueue_script( 'equalheights_script', get_stylesheet_directory_uri() . '/js/equal-heights.js', array('jquery'), '1.0.0' );
}
@media only screen and (min-width: 1024px) {
.content-sidebar .content-sidebar-wrap .content {
border-right: 1px solid #cbcbcb;
padding-right: 3rem;
}
}
jQuery(document).ready(function($) {
if (window.innerWidth > 1023) {
var highestCol = Math.max( $('.content-sidebar .content-sidebar-wrap .content').height(), $('.content-sidebar .sidebar-primary').height() );
$('.content-sidebar .content-sidebar-wrap .content, .content-sidebar .sidebar-primary').height(highestCol);
}
});
Screenshot: http://i.imgur.com/DG1Sn1E.png
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment