This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*------------------------------------------------------------------------------- | |
Filter Search Box Text | |
-------------------------------------------------------------------------------*/ | |
add_filter( 'genesis_search_text', 'custom_search_text' ); | |
function custom_search_text($text) { | |
return esc_attr('Enter keywords, hit enter;'); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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()) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<?php | |
global $post; | |
$args = array( | |
'post_status'=>'publish', | |
'post_type'=>'tribe_venue', | |
'posts_per_page'=>-1 | |
); | |
$get_posts = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*-----------------------------------------------------------------------------------*/ | |
/* 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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter('tribe_get_venue_link', 'my_custom_get_venue_link'); | |
function my_custom_get_venue_link($postId = null, $display = true) { | |
$url = esc_url( get_permalink( tribe_get_venue_id( $postId ) ) ); | |
if( $display && $url != '' ) { | |
$venue_name = tribe_get_venue($postId); | |
$link = '<a href="'.$url.'" title="'.$venue_name.'">'.$venue_name.'</a>'; | |
} else { | |
$link = $url; | |
} | |
if ( $display ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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 | |
*/ |