-
-
Save ckpicker/9963018 to your computer and use it in GitHub Desktop.
Events Calendar 3.4 // Modify height of Week View and change start time
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
//This function adds javascript to the <head> declaration of your site | |
//NOTE: This is only compatible with version 3.4 | |
add_action( 'wp_head', 'modify_week_view'); | |
function modify_week_view() { | |
?> | |
<script type="text/javascript"> | |
jQuery(document).ready(function ($) { | |
if($('.tribe-week-grid-wrapper').length){ | |
var height = 700; | |
function modify_slimscroll(){ | |
$('.tribe-week-grid-wrapper') | |
.unwrap() | |
.removeAttr('style') | |
.slimScroll({ | |
height: height + 'px', | |
railVisible: true, | |
alwaysVisible: true, | |
start: $('.time-row-8AM') | |
}); | |
} | |
modify_slimscroll(); | |
if (Object.prototype.hasOwnProperty.call(window, 'tribe_ev')) { | |
$(tribe_ev.events) | |
.on('tribe_ev_weekView_AjaxSuccess', function () { | |
modify_slimscroll(); | |
}); | |
} | |
} | |
}); | |
</script> | |
<?php | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment