Skip to content

Instantly share code, notes, and snippets.

View tomfinitely's full-sized avatar

Tom Finley tomfinitely

View GitHub Profile
@tomfinitely
tomfinitely / gist:936c11d21e057e100236
Last active August 29, 2015 14:18
YouTube oEmbed Filter
// customize embed settings
function custom_youtube_settings($code){
if(strpos($code, 'youtu.be') !== false || strpos($code, 'youtube.com') !== false){
$return = preg_replace("@src=(['\"])?([^'\">\s]*)@", "src=$1$2&showinfo=0&rel=0&autohide=1", $code);
return $return;
}
return $code;
}
add_filter('embed_handler_html', 'custom_youtube_settings');
@tomfinitely
tomfinitely / events-widgets.php
Last active December 4, 2021 01:23
The Events Calendar Pro - Cross-site Events Widget
<?php
if ( ! defined( 'ABSPATH' ) ) die('-1');
/*
* WDG-customized version of the Events Calendar Pro mini calendar widget.
* Changes are noted inline.
* Replacing class name: Tribe__Events__Pro__Mini_CalendarWidget
*/
class MultisiteTribeEventsProMiniCalendarWidget extends WP_Widget {
function __construct() {
@tomfinitely
tomfinitely / gist:d865d05937d60e47ddb7
Last active August 29, 2015 14:13
Genesis Sandbox Featured Content (GSFC) Widget Subtitles Function
add_action ( 'gsfc_post_content','add_subtitle', 10);
function add_subtitle(){
if ( function_exists( 'the_subtitle' ) ) {
the_subtitle( '<p class="entry-subtitle">', '</p>' );
}
}
@tomfinitely
tomfinitely / gist:1003f29506e6512bbb15
Created August 20, 2014 22:08
Genesis After Header Priority Mystery
//* Reposition Breadcrumbs
remove_action( 'genesis_before_loop', 'genesis_do_breadcrumbs' );
add_action( 'genesis_after_header', 'genesis_do_breadcrumbs', 6 );
//Page title relocation gateway, home & interior
add_action('genesis_after_header', 'relocate_page_titles', 8 );
function relocate_page_titles(){
if( is_front_page() ){
if( !is_main_site() ){
@tomfinitely
tomfinitely / events-widgets.php
Created July 17, 2014 19:06
Cross-Site Events Widgets
<?php
/**
* Master Calendar Upcoming Widget
*/
if( !class_exists( 'MasterCalendarUpcoming') ) {
class MasterCalendarUpcoming extends WP_Widget {
function MasterCalendarUpcoming() {
$widget_ops = array('classname' => 'MasterCalendarUpcoming', 'description' => __( 'Upcoming Events List from Master Calendar') );
@tomfinitely
tomfinitely / functions.php
Created July 17, 2014 18:58
Cross-Site Events Functions/Actions
// Events Calendar Modifications
if(class_exists( 'TribeEventsPro' )) {
include_once( CHILD_DIR . '/lib/events-widgets.php');
remove_action( 'widgets_init', 'events_calendar_load_featured_widget',100);
remove_action( 'widgets_init', 'events_list_load_widgets', 91 );
remove_action( 'widgets_init', 'events_calendar_load_widgets',100);
// Crazy-pants advanced widget magic
// $TribeEventsPro = new TribeEventsPro;
// remove_action( 'widgets_init', array($TribeEventsPro, 'pro_widgets_init'), 101 );
function do_it_activate_widgets() {
@tomfinitely
tomfinitely / faculty-acf-fields.php
Created July 16, 2014 15:11
Faculty & Video ACF Fields
if(function_exists("register_field_group"))
{
register_field_group(array (
'id' => 'acf_faculty-directory',
'title' => 'Faculty Directory',
'fields' => array (
array (
'key' => 'field_537a538dd069f',
'label' => 'Basic Info',
'name' => '',
@tomfinitely
tomfinitely / faculty.php
Created July 11, 2014 14:11
Faculty Custom Post Type for WordPress
<?php
/*
Plugin Name: Faculty Custom Post Type
Description: Adds custom post types for faculty members
Version: 0.1
License: GPL
Author: Oli Dale
Author URI: http://wplift.com
*/
@tomfinitely
tomfinitely / taxonomy-department.php
Created July 10, 2014 15:51
Faculty Taxonomy Template
<?php
/**
* Template Name: Departmental Taxonomy Template
*
*
* @category faculty
* @package Templates
* @author Thomas Finley <[email protected]>
* @copyright Copyright (c) 2014, Shenandoah University
* @license http://opensource.org/licenses/gpl-2.0.php GNU Public License
<?php
/**
* Faculty Archive
*
*/
add_action('genesis_meta', 'faculty_styles');
function faculty_styles() {
wp_enqueue_style( 'faculty-css', get_stylesheet_directory_uri() . '/css/faculty.css');