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 | |
| $args = array( | |
| 'post_status'=>'publish', | |
| 'post_type'=>array(TribeEvents::POSTTYPE), | |
| 'posts_per_page'=>100, | |
| 'tax_query' => array( | |
| array( | |
| 'taxonomy' => TribeEvents::TAXONOMY, | |
| 'field' => 'slug', |
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
| <ul> | |
| <?php | |
| $args = array( | |
| 'post_status'=>'publish', | |
| 'post_type'=>'tribe_organizer', | |
| 'posts_per_page'=>-1 | |
| ); | |
| $get_posts = null; | |
| $get_posts = new WP_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
| function filter_ical_description($item, $eventPost) { | |
| $description = preg_replace( "/[\n\t\r]/", ' ', strip_tags( strip_shortcodes( $eventPost->post_content ) ) ); | |
| $item[] = 'DESCRIPTION:' . str_replace( ',','\,', $description ); | |
| return $item; | |
| } | |
| add_filter('tribe_ical_feed_item','filter_ical_description', 10, 2); |
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
| /*------------------------------------------------------------------------------- | |
| Truncate Function For Excerpts | |
| -------------------------------------------------------------------------------*/ | |
| function trunc($phrase, $max_words) { | |
| $phrase_array = explode(' ',$phrase); | |
| if(count($phrase_array) > $max_words && $max_words > 0) { | |
| $phrase = implode(' ',array_slice($phrase_array, 0, $max_words)).' … '; | |
| } | |
| return $phrase; | |
| } |
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
| function filter_google_cal_params($params) { | |
| global $post; | |
| $event_details = substr( strip_shortcodes(get_the_content()), 0, 996 ) . '...'; | |
| $params = array( | |
| 'action' => 'TEMPLATE', | |
| 'text' => str_replace( ' ', '+', strip_tags( urlencode( $post->post_title ) ) ), | |
| 'dates' => $dates, | |
| 'details' => str_replace( ' ', '+', strip_tags( apply_filters( 'the_content', urlencode( $event_details ) ) ) ), | |
| 'location' => str_replace( ' ', '+', urlencode( $location ) ), | |
| 'sprop' => get_option( 'blogname' ), |
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 | |
| $upcoming = new WP_Query(); | |
| $upcoming->query( array( | |
| 'post_type' => 'tribe_events', | |
| 'eventDisplay' => 'upcoming', | |
| 'posts_per_page' => 10, | |
| ) ); | |
| $postids = Array(); | |
| if ($upcoming->have_posts()) : | |
| while ($upcoming->have_posts()) : |
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 | |
| /*-----------------------------------------------------------------------------------*/ | |
| /* Random Event Widget | |
| /*-----------------------------------------------------------------------------------*/ | |
| add_action( 'widgets_init', create_function( '', "register_widget( 'Random_Event_Widget' );" ) ); | |
| class Random_Event_Widget extends WP_Widget { |
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('wpseo_title','my_custom_titles'); | |
| function my_custom_titles($title) { | |
| if( tribe_is_month() && !is_tax() ) { // The Main Calendar Page | |
| return 'Events Calendar'; | |
| } elseif( tribe_is_month() && is_tax() ) { // Calendar Category Pages | |
| return 'Events Calendar' . ' » ' . single_term_title('', false); | |
| } elseif( tribe_is_event() && !tribe_is_day() && !is_single() ) { // The Main Events List | |
| return 'Events List'; |
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; | |
| $current_date = date('j M Y'); | |
| $end_date = date('j M Y', strtotime('1 month')); | |
| echo 'Start Date:'. $current_date; | |
| echo 'End Date:'. $end_date; | |
| $all_events = tribe_get_events( | |
| array( |
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 | |
| /*-----------------------------------------------------------------------------------*/ | |
| /* Modify Event List Order in Admin | |
| /*-----------------------------------------------------------------------------------*/ | |
| function set_custom_post_types_admin_order($wp_query) { | |
| if (is_admin()) { | |
| // Get the post type from the query | |
| $post_type = $wp_query->query['post_type']; | |
| if ( $post_type == 'tribe_events') { |