Skip to content

Instantly share code, notes, and snippets.

@rosshanney
rosshanney / gce-event.php
Created February 26, 2012 13:55
Extra shortcodes
<?php
class GCE_Event{
private $id;
private $title;
private $description;
private $location;
private $start_time;
private $end_time;
private $link;
private $type;
@rosshanney
rosshanney / currency-thingy.php
Created March 4, 2012 11:40
Currency switcher thingy
<?php
/*
Plugin name: Currency switcher thingy
*/
add_action( 'plugins_loaded', 'currency_setup' );
function currency_setup() {
add_action( 'publish_post', 'currency_publish_post' );
}
<?php
/*
Template Name: Projects
*/
get_header(); ?>
<div id="primary">
<div id="content" role="main">
@rosshanney
rosshanney / author-bio.php
Created April 22, 2012 22:02
Author bio template
<?php
/*
Template name: Author Bio
*/
?>
<?php get_header(); ?>
<?php //First output the page content (bio etc) ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php
/**
* The base configurations of the WordPress.
*
* This file has the following configurations: MySQL settings, Table Prefix,
* Secret Keys, WordPress Language, and ABSPATH. You can find more information
* by visiting {@link http://codex.wordpress.org/Editing_wp-config.php Editing
* wp-config.php} Codex page. You can get the MySQL settings from your web host.
*
* This file is used by the wp-config.php creation script during the
@rosshanney
rosshanney / gce-add-text-to-widget.php
Created June 9, 2012 17:03
Plugin to add text / HTML to bottom of GCE widget
<?php
/*
Plugin name: Add text to GCE widget
*/
function gce_after_widget_stuff( $params ) {
if ( ! is_admin() ) {
if ( 'Google Calendar Events' == $params[0]['widget_name'] ) {
$params[0]['after_widget'] = '<a href="http://your-url-here">LINK TEXT</a>' . $params[0]['after_widget'];
}
@rosshanney
rosshanney / gce-event.php
Created June 21, 2012 20:17
Adds [if-swd], [if-spd], [if-mwd] and [if-mpd] shortcodes to the event display builder
<?php
class GCE_Event{
private $id;
private $title;
private $description;
private $location;
private $start_time;
private $end_time;
private $link;
private $type;
<?php
/*
Plugin name: GCE Thickbox Thingy
*/
function gce_enqueue_thickbox() {
wp_enqueue_script( 'thickbox' );
wp_enqueue_style( 'thickbox' );
}
@rosshanney
rosshanney / allow-file-protocol.php
Created August 23, 2012 15:16
Allow file:/// protocol in WordPress
<?php
/*
Plugin name: Allow file protocol
*/
function rh_allow_file_protocol( $protocols ) {
$protocols[] = 'file';
return $protocols;
}
@rosshanney
rosshanney / gce-close-tooltips.php
Created October 1, 2012 19:20
Closes GCE tooltips when clicked / tapped
<?php
/*
Plugin name: Close GCE tooltips
Description: Causes Google Calendar Events tooltips to close when clicked / tapped.
*/
function gce_close_tooltips() {
?>
<script type="text/javascript">
function gce_close_tooltips() {