Skip to content

Instantly share code, notes, and snippets.

@neilgee
Last active August 29, 2015 14:27
Show Gist options
  • Save neilgee/dbbeb9870f2617034180 to your computer and use it in GitHub Desktop.
Save neilgee/dbbeb9870f2617034180 to your computer and use it in GitHub Desktop.
Equal Heights in Columns Using jQuery
<?php
function wpb_match_height() {
wp_enqueue_script ( 'matchheight' , get_stylesheet_directory_uri() . '/js/jquery.matchHeight-min.js', array( 'jquery' ), '1', true );
wp_enqueue_script ( 'matchheight-init' , get_stylesheet_directory_uri() . '/js/matchheight-init.js', array( 'matchheight' ), '1', true );
}
add_action( 'wp_enqueue_scripts', 'wpb_match_height' );
jQuery(function($) {
$('.post').matchHeight(); //set your target CSS class
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment