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
// Define what post types to include in search | |
function include_in_search( $query ) { | |
if ( $query->is_search ) { | |
$query->set( 'post_type', array( 'post', 'page', 'feed', 'tribe_events' )); | |
} | |
return $query; | |
} | |
add_filter( 'the_search_query', 'include_in_search' ); |
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 | |
$terms = get_terms("tribe_events_cat"); | |
$count = count($terms); | |
if ( $count > 0 ){ | |
echo '<ul class="events-cat-menu">'; | |
foreach ( $terms as $term ) { | |
echo '<li class="cat_'. $term->slug .'"><a href="'. get_term_link($term->slug, 'tribe_events_cat') .'">' . $term->name . '</a></li>'; | |
} | |
echo '</ul>'; | |
} |
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('wp_enqueue_scripts', 'example_enqueue_scripts'); | |
function example_enqueue_scripts() { | |
wp_dequeue_script('tribe-events-calendar-script'); | |
} | |
add_action('wp_footer', 'custom_events_script'); | |
function custom_events_script() { | |
wp_register_script('tribe-custom-calendar-script', get_bloginfo('stylesheet_directory') .'/events/events.js', array('jquery'), '1.0', true); // see http://codex.wordpress.org/Function_Reference/wp_enqueue_script for full details | |
wp_print_scripts('tribe-custom-calendar-script'); | |
} |
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 if (tribe_get_start_date() !== tribe_get_end_date() ) { ?> | |
<dt class="event-label event-label-date"><?php _e('Date:', 'tribe-events-calendar') ?></dt> | |
<dd class="event-meta event-meta-date"><meta itemprop="startDate" content="<?php echo tribe_get_start_date(null, false, 'Y-m-d'); ?>"/><?php echo tribe_get_start_date(null, false, 'F j, Y'); ?></dd> | |
<dt class="event-label event-label-start"><?php _e('Time:', 'tribe-events-calendar') ?></dt> | |
<dd class="event-meta event-meta-start"><meta itemprop="startDate" content="<?php echo tribe_get_start_date(null, false, 'h:i:s'); ?>"/><?php echo tribe_get_start_date(null, false, 'g:ia'); ?> to <meta itemprop="endDate" content="<?php echo tribe_get_end_date( null, false, 'h:i:s' ); ?>"/><?php echo tribe_get_end_date(null, false, 'g:ia'); ?></dd> | |
<?php } else { ?> | |
<dt class="event-label event-label-date"><?php _e('Date:', 'tribe-events-calendar') ?></dt> | |
<dd class="event-meta event-meta-date"><meta itemprop="startDate" content="<?php echo tribe_get_start_dat |
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
public function getEvents( $args = '' ) { | |
$tribe_ecp = TribeEvents::instance(); | |
// Determine if user can read private events. If so, pass private events by default, otherwise hide them. | |
global $current_user; | |
if (user_can( $current_user->ID, 'read_private_tribe_events' )) { | |
$defaults = array( | |
'posts_per_page' => tribe_get_option( 'postsPerPage', 10 ), | |
'post_type' => TribeEvents::POSTTYPE, | |
'orderby' => 'event_date', |