Skip to content

Instantly share code, notes, and snippets.

@rosshanney
rosshanney / gce-newer-jquery-easing.php
Created May 23, 2013 19:40
Load the newest version of the jQuery easing plugin in the Calypso theme
<?php
/*
Plugin name: Use newer jQuery easing plugin
*/
function gce_newer_easing() {
wp_dequeue_script( 'easing' );
wp_enqueue_script( 'gce-easing', plugins_url( 'jquery.easing.min.js', __FILE__ ), array( 'jquery' ) );
}
<?php
/*
Plugin name: GCE Thickbox
*/
function gce_thickbox_enqueue() {
wp_enqueue_script( 'thickbox' );
wp_enqueue_style( 'thickbox' );
}
@rosshanney
rosshanney / gce-titles-in-grid.css
Last active December 17, 2015 10:19
DIsplay event titles in grid cells (code by Jamie Goodwin)
.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;
@rosshanney
rosshanney / gce-alter-allowed-tags.php
Last active October 3, 2018 16:28
Add the itemprop, itemscope and itemtype attributes, and the meta tag to the list of allowed tags / attributes
<?php
/*
Plugin name: Add microdata stuff to list of allowed tags
*/
function gce_alter_allowed_tags() {
global $allowedposttags;
$microdata_atts = array( 'itemprop' => true, 'itemscope' => true, 'itemtype' => true );
@rosshanney
rosshanney / gce-alter-allowed-tags.php
Last active December 15, 2015 20:58
Adds <time> with datetime attribute to allowed post tags.
<?php
/*
Plugin name: Add time to allowed tags
*/
function gce_alter_allowed_tags() {
global $allowedposttags;
$allowedposttags['time'] = array(
'datetime' => true
<?php
/*
Plugin name: Alter allowed tags
*/
function gce_alter_allowed_tags() {
global $allowedposttags;
$allowedposttags['a']['data-toggle'] = true;
$allowedposttags['a']['data-target'] = true;
@rosshanney
rosshanney / gce-custom-styles.css
Created March 25, 2013 21:52
Some CSS styling for GCE grid widget
/* Make the top of the calendar dark blue, and fiddle with its height a little */
.gce-caption {
background: #003149;
color: #fff;
border: 1px solid #ccc;
border-bottom: none;
padding: 1em 0;
height: 20px;
line-height: 20px;
}
@rosshanney
rosshanney / gce-more-info-popup.php
Last active December 14, 2015 23:28
Popup for GCE more info links
<?php
/*
Plugin name: Popup for GCE more info links
*/
function gce_more_info_popup() {
?>
<script>
jQuery('body').on('click', '.gce-popup-link', function(e){
Popup(jQuery(this).attr('href'), jQuery(this).attr('id'), 400, 300);
@rosshanney
rosshanney / gce-close-tooltips-on-click.php
Created March 11, 2013 21:27
Close GCE tooltips on click / tap
<?php
/*
Plugin name: Close GCE tooltips on click / tap
*/
function gce_close_tooltips_on_click() {
if ( defined( 'GCE_VERSION' ) ) {
?>
<script type="text/javascript">
jQuery(document).ready(function(){
@rosshanney
rosshanney / gce-load-newer-jquery-ui.php
Created February 13, 2013 10:41
Load newer version of jQuery UI than version loaded by WP-UI plugin
<?php
/*
Plugin name: Load newer version of jQuery UI
*/
function gce_load_newer_jquery_ui() {
wp_deregister_script( 'jquery-ui' );
wp_enqueue_script( 'jquery-ui', 'https://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js', array( 'jquery') );
}