Skip to content

Instantly share code, notes, and snippets.

@stephenh1988
stephenh1988 / venue-tooltip-upcoming-events.php
Created December 2, 2012 18:34
Adds upcoming events to the venue tooltip in Event Organiser.
/**
* Adds upcoming events to the venue tooltip in Event Organiser.
*
* Uses the eventorganiser_venue_tooltip filter to append content to the venue tooltip. This tooltip appears when
* clicking a venue on a map (if tooltips are enabled).
* @uses eventorganiser_venue_tooltip.
*
* The filter passes 2 objects: the content of the toolip, the venue (term) ID
*
* @requires Event Organiser 1.6+
@stephenh1988
stephenh1988 / upcoming-events.php
Last active October 13, 2015 08:08
List upcoming events
/**
* Display a list of upcoming events with Event Organiser
*
* Snippet that produces a simple list of the next 5 upcoming events.
*/
//Get upcoming '
$events = eo_get_events(array(
'numberposts'=>5,
'event_start_after'=>'today',
@stephenh1988
stephenh1988 / body-class-event.php
Created November 28, 2012 12:47
Add classes to the body element of the page for event pages
/**
* A function which adds classes to event pages corresponding to the event
* E.g. adds 'eo-event-cat-[cat slug]' class for each category the event belongs to.
* Adds 'eo-event-venue-[venue slug]' if the event has a venue
* Adds time based class: eo-event-future/past/running for future/past/running events
*
* @url http://wordpress.org/support/topic/problem-with-highlight-in-menu-change-url-of-events?replies=8#post-3458829
* Not tested
*/
add_filter( 'body_class', 'my_event_organiser_add_classes_to_event_body');
@stephenh1988
stephenh1988 / simple-related-posts.php
Created November 24, 2012 15:01
A very simple way to retrieve and sort posts by relevancy based on overlap with taxonomy terms
@stephenh1988
stephenh1988 / widget-calendar-link.php
Created November 22, 2012 23:23
Replaces a link on the widget calendar with one that points to the a category for one of the events running on that date.
@stephenh1988
stephenh1988 / venue-name-in-event-tooltip.php
Created November 8, 2012 18:45
Include venue name in an event's calendar tooltip
/**
* Requires Event Organiser 1.6+
*
* Adds the venue's name to the content appearing in the tooltip when hovering over an event in fullcalendar
* @uses eventorganiser_event_tooltip filter.
*
* The filter passes 4 objects: the content of the toolip, the post ID of the event, the occurrence ID
* of the event and the post object (the last one probably won't often bed needed).
* In this example we just need the first two.
*/
@stephenh1988
stephenh1988 / cron-list.php
Created October 19, 2012 18:53 — forked from franz-josef-kaiser/cron-list.php
Plugin: List wp cron jobs in wp_footer
<?php
! defined( 'ABSPATH' ) AND exit;
/*
Plugin Name: WP Cron Jobs List
Plugin URI: https://github.com/franz-josef-kaiser
Description: List WordPress internal cron jobs (array data) after the footer. Based on Kaiser's original plug-in https://gist.github.com/987128
Author: Franz Josef Kaiser, Stephen Harris
Author URI: https://github.com/franz-josef-kaiser
Version: 0.3
License: MIT
@stephenh1988
stephenh1988 / venue-page.php
Created October 16, 2012 22:34
A page template that lists venues with Event Organiser
<?php
/**
* Template Name: Venue Archive
* Description: A page template that lists venues with Event Organiser. Just a simple example of what
* you can do.
* @link http://www.stephenharris.info/2012/taxonomy-archives-and-venue-pages-in-event-organiser/ Related Tutorial
*
* You can add this to your theme and then create a page, selecting it as the page template. The 'content' you enter is ignored, but you could edit this to include that too.
*/
@stephenh1988
stephenh1988 / front-end-event-creation.php
Created October 10, 2012 17:59
Front-end event creation with Event Organiser
<?php
/**
* This is a basic example of implementing front end creation of events with Event Organiser
* @see http://www.stephenharris.info/2012/front-end-event-posting/
* @see http://wordpress.org/extend/plugins/event-organiser/
*
*/
add_shortcode('my_event_form','my_event_form_shortcode_handler');
function my_event_form_shortcode_handler( ){
@stephenh1988
stephenh1988 / simple-admin-page.php
Created September 8, 2012 15:59
A simple class based on a tutorial at WP.Tuts that creates an page with metaboxes.
<?php
/*
Description: A simple class based on a tutorial at WP.Tuts that creates an page with metaboxes.
Author: Stephen Harris
Author URI: http://www.stephenharris.info
*/
/* Copyright 2011 Stephen Harris ([email protected])
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by