Last active
December 10, 2015 21:38
-
-
Save rosshanney/4496020 to your computer and use it in GitHub Desktop.
Expand event details on click
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
<?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