This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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">'; | |
| } |
This file contains hidden or 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 | |
| global $post; | |
| $myposts = tribe_get_events('post_type=tribe_events&posts_per_page=5&meta_key=_EventEndDate&orderby=meta_value&order=ASC&meta_compare=>=&meta_value='. date('Y-m-d G:i:s', current_time('timestamp'))); | |
| foreach($myposts as $post) : | |
| setup_postdata($post); | |
| ?> | |
| <?php date_default_timezone_set('America/Anchorage');?> | |
| <?php $event_date_raw = tribe_get_end_date( $post->ID, false, "Y-m-d G:i:s" ); | |
| $event_date = strtotime($event_date_raw); |
This file contains hidden or 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 | |
| /* | |
| * Resize images dynamically using wp built in functions | |
| * Victor Teixeira | |
| * | |
| * php 5.2+ | |
| * | |
| * Exemplo de uso: | |
| * | |
| * <?php |
This file contains hidden or 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( 'gettext', 'krogs_event_change_venue_name', 20, 3 ); | |
| /** | |
| * Change comment form default field names. | |
| * | |
| * @link http://codex.wordpress.org/Plugin_API/Filter_Reference/gettext | |
| */ | |
| function krogs_event_change_venue_name( $translated_text, $text, $domain ) { |
This file contains hidden or 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 this to your functions.php file to create a venue query that queries venues in order of number of events. | |
| // You may need to add a limit statement if you want more events to be returned than the default for the query. | |
| add_filter( 'pre_get_posts', 'my_function_to_get_venues_by_event_numbers', 10, 1 ); | |
| function my_function_to_get_venues_by_event_numbers( $query ) { | |
| if ( $query->tribe_is_event_venue && !is_single() ) { | |
| $query = new WP_Query(); | |
| $tribe_query = new TribeEventsQuery(); | |
| $query->query_vars['post_type'] = TribeEvents::VENUE_POST_TYPE; | |
| add_filter( 'posts_fields', 'my_posts_fields_for_venues_function', 20, 1 ); |
This file contains hidden or 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 Tribe Event Namespace | |
| add_filter( 'rss2_ns', 'events_rss2_namespace' ); | |
| function events_rss2_namespace() { | |
| echo 'xmlns:ev="http://purl.org/rss/2.0/modules/event/"'; | |
| } | |
| // Add Event Date to RSS Feeds | |
| add_action('rss_item','tribe_rss_feed_add_eventdate'); |