Skip to content

Instantly share code, notes, and snippets.

@rosshanney
Last active December 10, 2015 21:38
Show Gist options
  • Save rosshanney/4496020 to your computer and use it in GitHub Desktop.
Save rosshanney/4496020 to your computer and use it in GitHub Desktop.
Expand event details on click
<?php
/*
Plugin name: Expand event details on click
*/
function gce_expand_event_info_css() {
if ( defined( 'GCE_VERSION' ) ) {
?>
<style type="text/css">.gce-hidden{display:none;}.gce-event-title{cursor:pointer;}</style>
<?php
}
}
add_action( 'wp_head', 'gce_expand_event_info_css' );
function gce_expand_event_info_js() {
if ( defined( 'GCE_VERSION' ) ) {
?>
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery('.gce-event-title').click(function(){
jQuery(this).siblings('.gce-hidden').toggle();
});
});
</script>
<?php
}
}
add_action( 'wp_footer', 'gce_expand_event_info_js' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment