Skip to content

Instantly share code, notes, and snippets.

@ckpicker
Forked from faction23/gist:8675209
Last active August 29, 2015 13:58
Show Gist options
  • Save ckpicker/9963018 to your computer and use it in GitHub Desktop.
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 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