Last active
December 17, 2015 10:19
-
-
Save rosshanney/5594340 to your computer and use it in GitHub Desktop.
DIsplay event titles in grid cells (code by Jamie Goodwin)
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
.gce-has-events span:first-child { | |
color: #C60200 !important; font-weight: 700 !important; | |
} | |
.gce-page-grid .gce-calendar td { | |
vertical-align: top !important; | |
} | |
.gce-page-grid .gce-calendar td span:first-child { | |
display: block; float: left; clear: left; padding: 2px !important; margin-bottom: 3px; | |
font-size: 80% !important; line-height: 80%; | |
} | |
.gce-page-grid .gce-calendar td p { | |
clear: left; padding-left: 7px; | |
font-size: 80% !important; line-height: 80%; text-align: left; | |
} |
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
function gceTitleChange() { | |
jQuery('.gce-has-events').each(function(){ | |
var eventTitle = ""; | |
jQuery(this).find('.gce-list-event').each(function(){ | |
eventTitle += "<div>"; | |
eventTitle += jQuery(this).html(); | |
eventTitle += "</div>"; | |
}); | |
jQuery(this).append(eventTitle); | |
}); | |
} | |
gceTitleChange(); | |
jQuery(document).ajaxComplete(function(){ | |
gceTitleChange(); | |
}); |
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: GCE Titles in Grid | |
*/ | |
function gce_titles_in_grid_add_stuff() { | |
wp_enqueue_script( 'gce_titles_in_grid_script', plugins_url( 'gce-titles-in-grid.js', __FILE__ ), array( 'jquery' ), null, true ); | |
wp_enqueue_style( 'gce_titles_in_grid_css', plugins_url( 'gce-titles-in-grid.css', __FILE__ ) ); | |
} | |
add_action( 'wp_enqueue_scripts', 'gce_titles_in_grid_add_stuff' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment