Skip to content

Instantly share code, notes, and snippets.

View jo-snips's full-sized avatar

Jonah West jo-snips

View GitHub Profile
@jo-snips
jo-snips / gist:2026901
Created March 13, 2012 05:00 — forked from luetkemj/wp-query-ref.php
WordPress: Query $args
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@jo-snips
jo-snips / genesis-search-inpute-text.php
Created March 14, 2012 04:24
Genesis: Filter Search Input Text
/*-------------------------------------------------------------------------------
Filter Search Box Text
-------------------------------------------------------------------------------*/
add_filter( 'genesis_search_text', 'custom_search_text' );
function custom_search_text($text) {
return esc_attr('Enter keywords, hit enter;');
}
@jo-snips
jo-snips / alternate-page-title.php
Created March 15, 2012 16:53
The Events Calendar: Alternate Page Title
<h2>
<?php
if(tribe_is_month()) {
echo 'Calendar Grid';
} else if(tribe_is_event() && !tribe_is_day() && !is_single()) {
echo 'Event List';
} else if(tribe_is_event() && !tribe_is_day() && is_single()) {
echo 'Single Event';
} else if(tribe_is_day()) {
@jo-snips
jo-snips / thesis-body-classes.php
Created March 19, 2012 21:04
Thesis: Filter Body Classes
// Add a class for styling
function add_classes($classes) {
if('tribe_events' == get_post_type()) {
if ( is_single() && !tribe_is_showing_all() ) { // single event
$classes[] = 'single-event';
} elseif ( tribe_is_upcoming() || tribe_is_past() || tribe_is_day() || (is_single() && tribe_is_showing_all()) ) { // list view
$classes[] = 'list';
} else { // grid view
@jo-snips
jo-snips / exclude-categories-from-calendar.php
Created March 20, 2012 22:50
The Events Calendar: Exclude Category Events from Calendar
add_action( 'pre_get_posts', 'exclude_events_category' );
function exclude_events_category( $query ) {
if ( $query->query_vars['eventDisplay'] == 'month' && $query->query_vars['post_type'] == TribeEvents::POSTTYPE && !is_tax(TribeEvents::TAXONOMY) && empty( $query->query_vars['suppress_filters'] ) ) {
$query->set( 'tax_query', array(
array(
'taxonomy' => TribeEvents::TAXONOMY,
'field' => 'slug',
'terms' => array('2012'),
'operator' => 'IN'
@jo-snips
jo-snips / custom-query.php
Created March 27, 2012 00:54
The Events Calendar: Custom Venue Query
<ul>
<?php
global $post;
$args = array(
'post_status'=>'publish',
'post_type'=>'tribe_venue',
'posts_per_page'=>-1
);
$get_posts = null;
@jo-snips
jo-snips / browser-body-classes.php
Created March 29, 2012 17:56
Wordpress: Add Browser Body Classes
/*-----------------------------------------------------------------------------------*/
/* Adds new body classes
/*-----------------------------------------------------------------------------------*/
add_filter('body_class', 'add_browser_classes');
function add_browser_classes($classes){
if(is_singular()) {
global $post;
$classes[] = $post->post_name;
}
@jo-snips
jo-snips / custom_tribe_get_venue_link.php
Created March 30, 2012 18:25
The Events Calendar: Filter tribe_get_venue_link()
@jo-snips
jo-snips / woo-doc-title-filter.php
Created April 1, 2012 00:17
The Events Calendar: WooThemes Doc Title Filter
add_filter('woo_title', 'events_page_title');
function events_page_title( $title ) {
if ( is_single() && !tribe_is_showing_all() ) { // single event
$title = get_the_title();
} elseif ( tribe_is_upcoming() || tribe_is_past() || tribe_is_day() || (is_single() && tribe_is_showing_all()) ) { // list view
$title = "Upcoming Events List";
} else { // grid view
$title = "Calendar of Events";
@jo-snips
jo-snips / exclude-events-category.php
Last active October 2, 2015 15:38 — forked from jkudish/exclude-events-category.php
Exclude a specific category from Events Grid View
<?php
/**
* Exclude a specific category from Events Grid View
*
* @author jkudish
* @uses pre_get_posts filter
* @param object $query the query object
* @return object $query the filtered object
*/