Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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