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 | |
/*-----------------------------------------------------------------------------------*/ | |
/* Conditional Logic to Detect Various Event Related Views/Pages | |
/*-----------------------------------------------------------------------------------*/ | |
if( tribe_is_month() && !is_tax() ) { // Month View Page | |
echo 'were on the month view page'; | |
} elseif( tribe_is_month() && is_tax() ) { // Month View Category Page |
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 | |
add_action( 'init', array( &$this, 'change_post_object_label' ), 0 ); | |
add_action( 'admin_menu', array( &$this, 'change_post_menu_label' ), 0 ); | |
add_filter( 'post_updated_messages', array( &$this, 'post_updated_messages') ); | |
function change_post_menu_label() { | |
global $menu; | |
global $submenu; | |
if( isset( $menu[5], $submenu['edit.php'] ) ) { |
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 | |
/* Add to the bottom of your functions.php file. */ | |
function query_post_type($query) { | |
if(is_category() || is_tag() || is_archive() || is_search() || is_home() && empty( $query->query_vars['suppress_filters'] ) ) { | |
$post_type = get_query_var( 'post_type' ); | |
if ( $post_type ) | |
$post_type = $post_type; | |
else |
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 | |
add_filter( 'tribe_ical_feed_item', 'tribe_ical_add_alarm', 10, 2 ); | |
function tribe_ical_add_alarm( $item, $eventPost ) { | |
$alarm = tribe_get_custom_field( 'Alarm', $eventPost->ID ); | |
if ( !empty( $alarm ) ) { | |
$item[] = 'BEGIN:VALARM'; | |
$item[] = 'TRIGGER:-PT' . (int) $alarm . "M"; | |
$item[] = 'END:VALARM'; | |
} | |
return $item; |
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 | |
add_filter('pre_get_posts', 'tribe_filter_days_on_single_day', 20); | |
function tribe_filter_days_on_single_day($query) { | |
if (tribe_is_day()) { | |
$query->set('nopaging', true); | |
} | |
return $query; | |
} |
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 jQuery | |
/*-----------------------------------------------------------------------------------*/ | |
// Call the google CDN version of jQuery for the frontend | |
// Make sure you use this with wp_enqueue_script('jquery'); in your header | |
if (!is_admin()) add_action("wp_enqueue_scripts", "my_jquery_enqueue", 11); | |
function my_jquery_enqueue() { | |
wp_deregister_script('jquery'); | |
wp_register_script('jquery', "http" . ($_SERVER['SERVER_PORT'] == 443 ? "s" : "") . "://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js", false, null); | |
wp_enqueue_script('jquery'); |
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; | |
$current_date = date('n/j/Y',strtotime('1 day')); | |
$end_date = date('n/j/Y', strtotime('7 days')); | |
echo 'Current Date' . $current_date; | |
echo 'End Date' . $end_date; | |
$all_events = tribe_get_events( | |
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
<iframe src="<?php bloginfo('home'); ?>/events"></iframe> |
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 | |
function action_rss2_evns() { | |
echo 'xmlns:ev="http://purl.org/rss/1.0/modules/event/" | |
xmlns:xCal="urn:ietf:params:xml:ns:xcal"'; | |
} | |
add_action('rss2_ns', 'action_rss2_evns'); | |
function action_rss2_eventdates() { | |
global $post; |
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 (class_exists( 'TribeEvents' ) ) | |
add_action('wp_head','tribe_dont_index_day_views'); | |
function tribe_dont_index_day_views() { | |
$tribe_ecp = TribeEvents::instance(); | |
if( $tribe_ecp->displaying == 'day' ) | |
echo '<meta name="robots" content="noindex">'; | |
} |