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 / 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 / filter-custom-organizer-link.php
Created March 30, 2012 18:44
The Events Calendar: Filter tribe_get_organizer_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
*/
@jo-snips
jo-snips / mini-cal-day-link.php
Last active October 2, 2015 18:18
The Events Calendar: Mini Cal Day Link
@jo-snips
jo-snips / thesis-conditional-sidebars.php
Created April 4, 2012 19:56
Thesis: Set Sidebars Specifically with The Events Calendar
// Conditionally remove original sidebars
function no_sidebars() {
global $wp_query;
if('tribe_events' == get_post_type()) {
if ( $wp_query->query_vars['post_type'] == TribeEvents::POSTTYPE && is_single() && !is_tax(TribeEvents::TAXONOMY) ) { // single event
return true;
} elseif ( $wp_query->query_vars['eventDisplay'] == 'upcoming' || $wp_query->query_vars['eventDisplay'] == 'past' && $wp_query->query_vars['post_type'] == TribeEvents::POSTTYPE && !is_tax(TribeEvents::TAXONOMY) ) { // list view
return true;
@jo-snips
jo-snips / hide-acf-menu.php
Created April 5, 2012 22:07
Advanced Custom Fields: Hide ACF Menu
/*-------------------------------------------------------------------------------
Hide ACF menu item from the admin menu
-------------------------------------------------------------------------------*/
function hide_admin_menu() {
global $current_user;
get_currentuserinfo();
if($current_user->user_login != 'jonahcoyote') {
echo '<style type="text/css">#toplevel_page_edit-post_type-acf{display:none;}</style>';
}
@jo-snips
jo-snips / exclude-from-array.php
Created April 9, 2012 17:20
The Events Calendar: Remove Specific Custom Fields From Array
<?php $fields = tribe_get_custom_fields( get_the_ID() ); ?>
<?php unset($fields['Name']); ?>
<?php foreach ($fields as $label => $value) {
echo $label;
echo $value;
} ?>