Skip to content

Instantly share code, notes, and snippets.

View caseydriscoll's full-sized avatar

Casey Driscoll caseydriscoll

View GitHub Profile
@caseydriscoll
caseydriscoll / functions.php
Created November 3, 2015 03:20
Filter wp_terms_checklist_args Example
add_filter( 'wp_terms_checklist_args', 'eric_loz_category_fixer', 10, 2);
public function eric_loz_category_fixer( $args, $post_id ) {
$args['checked_ontop'] = false;
return $args;
}
<div class='gf_browser_chrome gform_wrapper' id='gform_wrapper_1' style='display:none'>
<a id='gf_1' name='gf_1' class='gform_anchor' ></a>
<form method='post' enctype='multipart/form-data' id='gform_1' action='/get-started/#gf_1'>
<div id='gf_progressbar_wrapper_1' class='gf_progressbar_wrapper'>
<h3 class='gf_progressbar_title'>Step 2 of 3
</h3>
<div class='gf_progressbar'>
<div class='gf_progressbar_percentage percentbar_blue percentbar_66' style='width:66%;'><span>66%</span></div>
</div>
</div>
form:
action: 'do/this'
class: 'questionaire'
short:
name: 'First Name'
label: 'first-name'
short:
@caseydriscoll
caseydriscoll / menu.html
Last active August 29, 2015 14:21
Oreo Menu
<a class="oreo-menu" href="#menu">
<div class="oreo"></div>
<div class="oreo"></div>
<div class="oreo"></div>
</a>
@caseydriscoll
caseydriscoll / functions.php
Last active August 29, 2015 14:21
Page slug to body class
// Page Slug Body Class
// http://www.wpbeginner.com/wp-themes/how-to-add-page-slug-in-body-class-of-your-wordpress-themes/
function add_slug_body_class( $classes ) {
global $post;
if ( isset( $post ) ) {
$classes[] = $post->post_type . '-' . $post->post_name;
}
return $classes;
@caseydriscoll
caseydriscoll / markup.html
Last active August 29, 2015 14:21
Pure CSS Tabs
<div class="tabs-wrapper">
<input type="radio" name="tab" id="tab1" class="tab-head" checked="checked"/>
<label for="tab1">One</label>
<input type="radio" name="tab" id="tab2" class="tab-head" />
<label for="tab2">Two</label>
<input type="radio" name="tab" id="tab3" class="tab-head" />
<label for="tab3">Three</label>
<input type="radio" name="tab" id="tab4" class="tab-head" />
<label for="tab4">Four</label>
<div class="tab-body-wrapper">
add_filter( 'genesis_pre_load_favicon', 'patchworks_custom_favicon' );
/**
* Adds custom favicon from child theme directory
*
* @author caseypatrickdriscoll casey@patch.works
*
* @created 2015-05-12 11:28:06
*
* @param string $favicon_url The location of the current favicon
add_action( 'wp_enqueue_scripts', 'genesis_parent_theme_enqueue_styles' );
function genesis_parent_theme_enqueue_styles() {
wp_enqueue_style( 'patchworks-fontawesome', patchworks_fontawesome() );
}
function patchworks_fontawesome() {
return 'https://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css';
}
@caseydriscoll
caseydriscoll / functions.php
Created August 13, 2014 19:03
Tribe: Fix Month View link problem for recurring events
// When you only have recurring events, the next month link won't show. Resave the event or add this snippet.
// Written by Barry Hughes
// Problem thread: http://tri.be/support/forums/topic/one-side-of-month-pagination-missing/
add_action( 'added_post_meta', 'fix_29781_recurrence_pagination', 10, 3 );
function fix_29781_recurrence_pagination( $meta_id, $object_id, $meta_key ) {
if ( TribeEvents::POSTTYPE !== get_post_type( $object_id ) ) return;
if ( '_EventDuration' !== $meta_key ) return;
TribeEvents::instance()->rebuild_earliest_latest();
@caseydriscoll
caseydriscoll / functions.php
Created August 8, 2014 15:50
Tribe: Change date format on Community Events Add form
// NOTE: This won't fully work, as the date format is changed back with javascript
// once the user selects a date with the date picker.
// Add this to your active theme's functions.php
add_filter( 'tribe_community_events_get_start_date', 'tribe_change_community_events_date_format' );
function tribe_change_community_events_date_format( $date, $event_id ) {
$date = date( 'y-m-d', strtotime( $date ) ); // change date configuration to desired
return $date;
}