public static function render_single_event_title() { $event_id = get_the_ID(); ?> <div class="fusion-events-single-title-content"> <?php the_title('<h2 class="tribe-events-single-event-title summary entry-title">', '</h2>'); ?> <div class="tribe-events-schedule updated published tribe-clearfix"> <?php echo tribe_events_event_schedule_details($event_id, '<h3>', '</h3>'); ?> <?php if (tribe_get_cost()) { ?> <span class="tribe-events-divider">|</span> <span class="tribe-events-cost"><?php echo tribe_get_cost(null, true); ?> </span> <?php } ?> </div> </div> <?php }
/** * Frontend Shortcode Handler * * @param array $atts array of attributes * @param string $content text within enclosing form of shortcode element * @param string $shortcodename the shortcode found, when == callback name * @return string $output returns the modified html string */ function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { $atts = shortcode_atts(array('categories' => "", 'items' => "3", 'paginate' => "no"), $atts, $this->config['shortcode']); $output = ""; $posts = $this->query_entries($atts); $entries = $posts->posts; if (class_exists('Tribe__Events__Pro__Main')) { $ecp = Tribe__Events__Pro__Main::instance(); $ecp->disable_recurring_info_tooltip(); } if (!empty($entries)) { global $post; $default_id = $post->ID; $output .= "<div class='av-upcoming-events " . $meta['el_class'] . "'>"; foreach ($entries as $entry) { $class = "av-upcoming-event-entry"; $image = get_the_post_thumbnail($entry->ID, 'square', array('class' => 'av-upcoming-event-image')); $class .= !empty($image) ? " av-upcoming-event-with-image" : " av-upcoming-event-without-image"; $title = get_the_title($entry->ID); $link = get_permalink($entry->ID); $post->ID = $entry->ID; //temp set of the post id so that tribe fetches the correct price symbol $price = tribe_get_cost($entry->ID, true); $venue = tribe_get_venue($entry->ID); $post->ID = $default_id; $output .= "<a href='{$link}' class='{$class}'>"; if ($image) { $output .= $image; } $output .= "<span class='av-upcoming-event-data'>"; $output .= "<h4 title='av-upcoming-event-title'>{$title}</h4>"; $output .= "<span class='av-upcoming-event-meta'>"; $output .= "<span class='av-upcoming-event-schedule'>" . tribe_events_event_schedule_details($entry) . "</span>"; if ($price) { $output .= "<span class='av-upcoming-event-cost'>{$price}</span>"; } if ($price && $venue) { $output .= " - "; } if ($venue) { $output .= "<span class='av-upcoming-event-venue'>{$venue}</span>"; } $output .= apply_filters('avf_upcoming_event_extra_data', "", $entry); $output .= "</span>"; $output .= "</span>"; $output .= "</a>"; } if ($atts['paginate'] == "yes" && ($avia_pagination = avia_pagination($posts->max_num_pages, 'nav'))) { $output .= "<div class='pagination-wrap pagination-" . Tribe__Events__Main::POSTTYPE . "'>{$avia_pagination}</div>"; } $output .= "</div>"; } if (class_exists('Tribe__Events__Pro__Main')) { // Re-enable recurring event info $ecp->enable_recurring_info_tooltip(); } return $output; }
/** * Set the banner subtitle for a single event. * * @return string * @access public * @since 1.0.0 */ public function set_banner_subtitle($subtitle) { if (is_singular('tribe_events')) { $subtitle = tribe_events_event_schedule_details(get_the_ID()); } return $subtitle; }
<?php if (tribe_get_cost()) { ?> <div class="tribe-events-event-cost"> <span><?php echo tribe_get_cost(null, true); ?> </span> </div> <?php } ?> <div class="tribe-event-schedule-details"> <?php echo tribe_events_event_schedule_details(); ?> </div> <!-- Event Title --> <?php do_action('tribe_events_before_the_event_title'); ?> <h2 class="tribe-events-list-event-title"> <a class="tribe-event-url" href="<?php echo esc_url(tribe_get_event_link()); ?> " title="<?php the_title_attribute(); ?> " rel="bookmark">
/** * Returns json for javascript templating functions throughout the plugin. * * @category Events * * @param $event * @param $additional * * @return string */ function tribe_events_template_data($event, array $additional = null) { $has_image = false; $image_src = ''; $image_tool_src = ''; $date_display = ''; //Disable recurring event info in tooltip if (class_exists('Tribe__Events__Pro__Main')) { $ecp = Tribe__Events__Pro__Main::instance(); $ecp->disable_recurring_info_tooltip(); $date_display = strip_tags(tribe_events_event_schedule_details($event)); // Re-enable recurring event info $ecp->enable_recurring_info_tooltip(); } else { $date_display = strip_tags(tribe_events_event_schedule_details($event)); } if (function_exists('has_post_thumbnail') && has_post_thumbnail($event->ID)) { $has_image = true; $image_arr = wp_get_attachment_image_src(get_post_thumbnail_id($event->ID), 'medium'); $image_src = $image_arr[0]; } if ($has_image) { $image_tool_arr = wp_get_attachment_image_src(get_post_thumbnail_id($event->ID), array(75, 75)); $image_tool_src = $image_tool_arr[0]; } if (has_excerpt($event->ID)) { $excerpt = $event->post_excerpt; } else { $excerpt = $event->post_content; } $excerpt = Tribe__Events__Main::instance()->truncate($excerpt, 30); $category_classes = tribe_events_event_classes($event->ID, false); $json = array('eventId' => $event->ID, 'title' => $event->post_title, 'permalink' => tribe_get_event_link($event->ID), 'imageSrc' => $image_src, 'dateDisplay' => $date_display, 'imageTooltipSrc' => $image_tool_src, 'excerpt' => $excerpt, 'categoryClasses' => $category_classes); /** * Template overrides (of month/tooltip.php) set up in 3.9.3 or earlier may still expect * these vars and will break without them, so they are being kept temporarily for * backwards compatibility purposes. * * @todo consider removing in 4.0 */ $json['startTime'] = tribe_get_start_date($event); $json['endTime'] = tribe_get_end_date($event); if ($additional) { $json = array_merge((array) $json, (array) $additional); } $json = apply_filters('tribe_events_template_data_array', $json, $event, $additional); $json = tribe_prepare_for_json_deep($json); return json_encode($json); }
/** * Returns json for javascript templating functions throughout the plugin. * * @category Events * * @param $event * @param $additional * * @return string */ function tribe_events_template_data($event = null, array $additional = null) { // Base JSON variable $json = array('i18n' => array()); if (!is_null($event)) { $event = get_post($event); // Check if we are dealing with an Event if (is_object($event) && $event instanceof WP_Post && tribe_is_event($event->ID)) { $has_image = false; $image_src = ''; $image_tool_src = ''; $date_display = ''; //Disable recurring event info in tooltip if (class_exists('Tribe__Events__Pro__Main')) { $ecp = Tribe__Events__Pro__Main::instance(); $ecp->disable_recurring_info_tooltip(); $date_display = strip_tags(tribe_events_event_schedule_details($event)); // Re-enable recurring event info $ecp->enable_recurring_info_tooltip(); } else { $date_display = strip_tags(tribe_events_event_schedule_details($event)); } if (function_exists('has_post_thumbnail') && has_post_thumbnail($event->ID)) { $has_image = true; $image_arr = wp_get_attachment_image_src(get_post_thumbnail_id($event->ID), 'medium'); $image_src = $image_arr[0]; } if ($has_image) { $image_tool_arr = wp_get_attachment_image_src(get_post_thumbnail_id($event->ID), array(75, 75)); $image_tool_src = $image_tool_arr[0]; } if (has_excerpt($event->ID)) { $excerpt = $event->post_excerpt; } else { $excerpt = $event->post_content; } $excerpt = Tribe__Events__Main::instance()->truncate($excerpt, 30); $category_classes = tribe_events_event_classes($event->ID, false); $json['eventId'] = $event->ID; $json['title'] = $event->post_title; $json['permalink'] = tribe_get_event_link($event->ID); $json['imageSrc'] = $image_src; $json['dateDisplay'] = $date_display; $json['imageTooltipSrc'] = $image_tool_src; $json['excerpt'] = $excerpt; $json['categoryClasses'] = $category_classes; /** * Template overrides (of month/tooltip.php) set up in 3.9.3 or earlier may still expect * these vars and will break without them, so they are being kept temporarily for * backwards compatibility purposes. * * @todo consider removing in 4.0 */ $json['startTime'] = tribe_get_start_date($event); $json['endTime'] = tribe_get_end_date($event); } } /** * Internationalization Strings */ $json['i18n']['find_out_more'] = esc_attr__('Find out more »', 'tribe-events-calendar'); $json['i18n']['for_date'] = esc_attr(sprintf(__('%s for', 'tribe-events-calendar'), tribe_get_event_label_plural())); if ($additional) { $json = array_merge((array) $json, (array) $additional); } $json = apply_filters('tribe_events_template_data_array', $json, $event, $additional); $json = tribe_prepare_for_json_deep($json); return json_encode($json); }
?> <div class="byline"> <a class="categoria-noticia" href="<?php echo tribe_get_events_link(); ?> "> Agenda</a> <?php the_title('<h2 class="tribe-events-single-event-title summary entry-title single-title">', '</h2>'); ?> <div class="tribe-events-schedule updated published tribe-clearfix"> <?php echo tribe_events_event_schedule_details($event_id, '', ''); ?> <?php if (tribe_get_cost()) { ?> <span class="tribe-events-divider">|</span> <span class="tribe-events-cost"><?php echo tribe_get_cost(null, true); ?> </span> <?php } ?> </div> </div>
echo tribe_get_event_link(); ?> "><?php the_post_thumbnail('homepage-thumb', array('class' => "img-responsive")); ?> </a> <?php } ?> <?php $sep = ""; if (tribe_get_city() && tribe_get_stateprovince()) { $sep = ", "; } ?> <h2><a href="<?php echo tribe_get_event_link(); ?> "><?php the_title(); ?> </a></h2> <?php echo tribe_events_event_schedule_details($event_id, '<span class="date small">', '</span>'); ?> <h3><?php echo tribe_get_city() . $sep . tribe_get_stateprovince(); ?> </h3> <?php the_excerpt();
/** * Display the related posts * * @since 1.0 * @author Modern Tribe * @param string $tags comma-separated list of tags. * @param int $count number of related posts to return. * @param string $blog the blog from which to fetch the related posts. * @param bool $only_display_related whether to display only related posts or others as well. * @param bool $thumbnails whether to display thumbnails or not. * @param string $post_type the type of post to return. * @return void */ public function displayPosts($tag = false, $category = false, $count = 5, $blog = false, $only_display_related = false, $thumbnails = false, $post_type = 'post') { // Create an array of types if the user submitted more than one. $post_type = explode(',', $post_type); $posts = self::getPosts($tag, $category, $count, $blog, $only_display_related, $post_type); if (is_array($posts) && count($posts)) { echo '<ul class="tribe-related-posts">'; foreach ($posts as $post) { echo '<li>'; if ($thumbnails) { $thumb = get_the_post_thumbnail($post->ID, 'tribe-related-posts-thumbnail'); if ($thumb) { echo '<div class="tribe-related-posts-thumbnail"><a href="' . get_permalink($post) . '">' . $thumb . '</a></div>'; } } echo '<div class="tribe-related-posts-title"><a href="' . get_permalink($post) . '">' . get_the_title($post) . '</a></div>'; if (class_exists('TribeEvents') && $post->post_type == TribeEvents::POSTTYPE && function_exists('tribe_events_event_schedule_details')) { echo tribe_events_event_schedule_details($post); } echo '</li>'; echo '<hr />'; } echo '</ul>'; } }
function tribe_upcoming_events($atts) { // Attributes extract(shortcode_atts(array('number' => 3, 'usecols' => true, 'cols' => 3), $atts)); // Code add_filter('excerpt_length', 'tekserve_studio_excerpt_length', 999); $html = '<div id="tribe-events-content" class="tekserve-studio-tribe-events tribe-events-list tribe-events-photo"> <div class="tribe-events-loop hfeed vcalendar tribe-clearfix" id="tribe-events-photo-events">'; $args = array('post_type' => 'tribe_events', 'post_status' => 'publish', 'posts_per_page' => $number); $the_query = new WP_Query($args); // The Loop if ($the_query->have_posts()) { if ($usecols) { if (intval($cols) > 12) { $cols = intval($cols / 12); } //end if( intval( $cols ) > 12 ) $colsize = intval(12 / $cols); $coltag = '[column size="' . $colsize . '" col_class="md"]'; $i = 0; while ($the_query->have_posts()) { $post = $the_query->the_post(); if ($i == 0) { $html .= '[row]'; } //end if( $i == 0 ) $html .= $coltag; $html .= '<div class="tribe-events-photo-event-wrap">'; $html .= tribe_event_featured_image(null, 'medium'); $html .= '<div class="tribe-events-event-details tribe-clearfix">'; $html .= print_r(do_action('tribe_events_before_the_event_title'), true); $html .= '<h3 class="tribe-events-list-event-title entry-title summary">'; $html .= '<a class="url" href="' . esc_url(tribe_get_event_link()) . '" title="' . the_title('', '', false) . '" rel="bookmark">'; $html .= the_title('', '', false); $html .= '</a></h3>'; $html .= print_r(do_action('tribe_events_after_the_event_title'), true); $html .= print_r(do_action('tribe_events_before_the_meta'), true); $html .= '<div class="tribe-events-event-meta"> <div class="updated published time-details">'; if (!empty($post->distance)) { $html .= '<strong>[' . tribe_get_distance_with_unit($post->distance) . ']</strong>'; } //end if( ! empty( $post->distance ) ) $html .= tribe_events_event_schedule_details(); $html .= '</div> </div>'; $html .= print_r(do_action('tribe_events_after_the_meta'), true); $html .= print_r(do_action('tribe_events_before_the_content'), true); $html .= '<div class="tribe-events-list-photo-description tribe-events-content entry-summary description">'; $html .= tribe_events_get_the_excerpt(); $html .= '</div>'; $html .= print_r(do_action('tribe_events_after_the_content'), true); $html .= ' </div> </div>'; $html .= '[/column]'; if ($i == intval($cols - 1)) { $html .= '[/row]'; } //end if( $i == intval( $cols-1 ) ) if ($i < $cols) { $i++; } else { $i = 0; } //end if( $i < $cols ) } //end while( $the_query->have_posts() ) } else { while ($the_query->have_posts()) { $post = $the_query->the_post(); $html .= '<div class="tribe-events-photo-event-wrap">'; $html .= tribe_event_featured_image(null, 'medium'); $html .= '<div class="tribe-events-event-details tribe-clearfix">'; $html .= print_r(do_action('tribe_events_before_the_event_title'), true); $html .= '<h3 class="tribe-events-list-event-title entry-title summary">'; $html .= '<a class="url" href="' . esc_url(tribe_get_event_link()) . '" title="' . the_title('', '', false) . '" rel="bookmark">'; $html .= the_title('', '', false); $html .= '</a></h3>'; $html .= print_r(do_action('tribe_events_after_the_event_title'), true); $html .= print_r(do_action('tribe_events_before_the_meta'), true); $html .= '<div class="tribe-events-event-meta"> <div class="updated published time-details">'; if (!empty($post->distance)) { $html .= '<strong>[' . tribe_get_distance_with_unit($post->distance) . ']</strong>'; } //end if( ! empty( $post->distance ) ) $html .= tribe_events_event_schedule_details(); $html .= '</div> </div>'; $html .= print_r(do_action('tribe_events_after_the_meta'), true); $html .= print_r(do_action('tribe_events_before_the_content'), true); $html .= '<div class="tribe-events-list-photo-description tribe-events-content entry-summary description">'; $html .= tribe_events_get_the_excerpt(); $html .= '</div>'; $html .= print_r(do_action('tribe_events_after_the_content'), true); $html .= ' </div> </div>'; } //end while( $the_query->have_posts() ) } //end if( $usecols ) } else { return '<h3 class="error">There are currently no upcoming events.</h3>'; } //end if( $the_query->have_posts() ) $html .= ' </div> </div>'; return do_shortcode($html); }
function shortcode_events_cal($atts, $content = null) { extract(shortcode_atts(array('count' => '', 'columns' => '4', 'show_title' => 'yes', 'show_image' => 'yes', 'show_date' => 'yes', 'show_excerpt' => 'yes', 'text_align' => 'left', 'el_class' => ''), $atts)); $html = ''; $args = array('post_type' => 'tribe_events', 'posts_per_page' => $count, 'orderby' => 'menu_order', 'order' => 'DESC'); $text_align = $text_align != 'left' ? 'event_align_' . $text_align : ''; $events = new WP_Query($args); if ($events->have_posts()) { $html .= '<div class="event_calendar_wrap clearfix">'; $columns = (int) $columns; while ($events->have_posts()) { $events->the_post(); $thumb_id = get_post_thumbnail_id(); $thumb_link = wp_get_attachment_image_src($thumb_id, 'full', true); $html .= '<article class="col columns-' . $columns . '">'; if ($show_image == 'yes') { $html .= '<figure>'; $html .= '<a href="' . get_the_permalink() . '" class="url" rel="bookmark">'; $html .= '<div class="text-overlay">'; $html .= '<div class="info"><i class="fa fa-search"></i></div>'; $html .= '</div>'; $html .= '<img src="' . $thumb_link[0] . '">'; $html .= '</a>'; $html .= '</figure>'; } $html .= '<div class="description ' . $text_align . '">'; if ($show_title == 'yes') { $html .= '<h2><a href="' . get_the_permalink() . '" class="url" rel="bookmark">' . get_the_title() . '</a></h2>'; } if (function_exists('tribe_events_event_schedule_details')) { if ($show_date == 'yes') { $html .= '<h4>' . tribe_events_event_schedule_details() . '</h4>'; } if ($show_excerpt == 'yes') { $html .= '<div class="event_excerpt">'; $html .= string_limit_words(get_the_excerpt(), 15) . '...'; $html .= '</div>'; } /* if(function_exists(tribe_get_cost)){ if ( tribe_get_cost() ) : $html .= '<div class="tribe-events-event-cost">'; $html .= '<span>' . tribe_get_cost( null, true ) . '</span>'; $html .= '</div>'; endif; } */ } $html .= '</div>'; $html .= '</article>'; } wp_reset_query(); $html .= '</div>'; } return $html; }
/** * Echos the single events page related events boxes. * * @param mixed $tag The specific tags you want it relating to. * @param mixed $category The specific categories you want it relating to. * @param int $count The number of related events to find. * @return void. */ function tribe_single_related_events($count = 3) { $posts = tribe_get_related_posts($count); if (is_array($posts) && !empty($posts)) { echo '<h3 class="tribe-events-related-events-title">' . __('Related Events', 'tribe-events-calendar-pro') . '</h3>'; echo '<ul class="tribe-related-events tribe-clearfix hfeed vcalendar">'; foreach ($posts as $post) { echo '<li>'; $thumb = has_post_thumbnail($post->ID) ? get_the_post_thumbnail($post->ID, 'large') : '<img src="' . trailingslashit(TribeEventsPro::instance()->pluginUrl) . 'resources/images/tribe-related-events-placeholder.png" alt="' . get_the_title($post->ID) . '" />'; echo '<div class="tribe-related-events-thumbnail">'; echo '<a href="' . tribe_get_event_link($post) . '" class="url" rel="bookmark">' . $thumb . '</a>'; echo '</div>'; echo '<div class="tribe-related-event-info">'; echo '<h3 class="tribe-related-events-title summary"><a href="' . tribe_get_event_link($post) . '" class="url" rel="bookmark">' . get_the_title($post->ID) . '</a></h3>'; if ($post->post_type == TribeEvents::POSTTYPE) { echo tribe_events_event_schedule_details($post); } echo '</div>'; echo '</li>'; } echo '</ul>'; } }
/** * Prints correct title/subtitle for all cases */ function grve_header_title() { global $post; $page_title = $page_description = $page_reversed = ''; //Shop if (grve_woocommerce_enabled() && is_shop() && !is_search()) { $post_id = wc_get_page_id('shop'); $page_title = get_the_title($post_id); $page_description = get_post_meta($post_id, 'grve_page_description', true); return array('title' => $page_title, 'description' => $page_description); } //Events Calendar Overview Pages if (grve_events_calendar_is_overview()) { return array('title' => tribe_get_events_title(true), 'description' => ''); } //Main Pages if (is_front_page() && is_home()) { // Default homepage $page_title = get_bloginfo('name'); $page_description = get_bloginfo('description'); } else { if (is_front_page()) { // static homepage $page_title = get_bloginfo('name'); $page_description = get_bloginfo('description'); } else { if (is_home()) { // blog page $page_title = get_bloginfo('name'); $page_description = get_bloginfo('description'); } else { if (is_search()) { $page_description = __('Search Results for :', GRVE_THEME_TRANSLATE); $page_title = esc_attr(get_search_query()); $page_reversed = 'reversed'; } else { if (is_singular()) { $post_id = $post->ID; $post_type = get_post_type($post_id); //Single Post if ($post_type == 'page' && is_singular('page')) { $page_title = get_the_title(); $page_description = get_post_meta($post_id, 'grve_page_description', true); } else { if ($post_type == 'portfolio' && is_singular('portfolio')) { $page_title = get_the_title(); $page_description = get_post_meta($post_id, 'grve_portfolio_description', true); } else { if (grve_events_calendar_enabled() && $post_type == 'tribe_events' && is_singular('tribe_events')) { $page_title = get_the_title(); $page_description = tribe_events_event_schedule_details($post_id, '', ''); if (tribe_get_cost()) { $page_description .= '<span class="grve-event-cost grve-bg-primary-1">' . tribe_get_cost(null, true) . '</span>'; } } else { if (grve_events_calendar_enabled() && $post_type == 'tribe_organizer' && is_singular('tribe_organizer')) { $page_title = get_the_title(); $page_description = grve_event_organizer_title_meta(); } else { $page_title = get_the_title(); } } } } } else { if (is_archive()) { //Post Categories if (is_category()) { $page_title = single_cat_title("", false); $page_description = category_description(); } else { if (is_tag()) { $page_description = __("Posts Tagged :", GRVE_THEME_TRANSLATE); $page_title = single_tag_title("", false); $page_reversed = 'reversed'; } else { if (is_author()) { global $author; $userdata = get_userdata($author); $page_description = __("Posts By :", GRVE_THEME_TRANSLATE); $page_title = $userdata->display_name; $page_reversed = 'reversed'; } else { if (is_day()) { $page_description = __("Daily Archives :", GRVE_THEME_TRANSLATE); $page_title = get_the_time('l, F j, Y'); $page_reversed = 'reversed'; } else { if (is_month()) { $page_description = __("Monthly Archives :", GRVE_THEME_TRANSLATE); $page_title = get_the_time('F Y'); $page_reversed = 'reversed'; } else { if (is_year()) { $page_description = __("Yearly Archives :", GRVE_THEME_TRANSLATE); $page_title = get_the_time('Y'); $page_reversed = 'reversed'; } else { if (grve_woocommerce_enabled() && is_tax()) { $page_title = single_term_title("", false); } else { $page_title = __("Archives", GRVE_THEME_TRANSLATE); } } } } } } } } else { $page_title = get_bloginfo('name'); $page_description = get_bloginfo('description'); } } } } } } return array('title' => $page_title, 'description' => $page_description, 'reversed' => $page_reversed); }
<?php /** * Related Events Template */ if (!defined('ABSPATH')) { die('-1'); } $posts = tribe_get_related_posts(); if (is_array($posts) && !empty($posts)) { echo '<div class="grve-related-post">'; echo '<h5 class="grve-related-title">' . __('Related Events', GRVE_THEME_TRANSLATE) . '</h5>'; echo '<ul>'; foreach ($posts as $post) { echo '<li>'; $thumb = has_post_thumbnail($post->ID) ? get_the_post_thumbnail($post->ID, 'grve-image-small-rect-horizontal') : '<img src="' . get_template_directory_uri() . '/images/empty/tribe-related-events-placeholder.png" alt="' . get_the_title($post->ID) . '" />'; echo '<div class="grve-media grve-image-hover">'; echo '<a href="' . tribe_get_event_link($post) . '" class="url" rel="bookmark">' . $thumb . '</a>'; echo '</div>'; echo '<div class="grve-content">'; echo '<a href="' . tribe_get_event_link($post) . '" class="url" rel="bookmark"><h6 class="grve-title">' . get_the_title($post->ID) . '</h6></a>'; if ($post->post_type == TribeEvents::POSTTYPE) { echo '<div class="grve-caption">' . tribe_events_event_schedule_details($post) . '</div>'; } echo '</div>'; echo '</li>'; } echo '</ul>'; echo '</div>'; }
/** * Frontend Shortcode Handler * * @param array $atts array of attributes * @param string $content text within enclosing form of shortcode element * @param string $shortcodename the shortcode found, when == callback name * @return string $output returns the modified html string */ function shortcode_handler($atts, $content = "", $shortcodename = "", $meta = "") { $atts = shortcode_atts(array('categories' => "", 'items' => "3", 'paginate' => "no"), $atts, $this->config['shortcode']); $output = ""; $posts = $this->query_entries($atts); $entries = $posts->posts; if (!empty($entries)) { $output .= "<div class='av-upcoming-events " . $meta['el_class'] . "'>"; foreach ($entries as $entry) { $class = "av-upcoming-event-entry"; $image = get_the_post_thumbnail($entry->ID, 'square', array('class' => 'av-upcoming-event-image')); $class .= empty($image) ? " av-upcoming-event-with-image" : " av-upcoming-event-without-image"; $title = get_the_title($entry->ID); $link = get_permalink($entry->ID); $price = tribe_get_cost($entry->ID, true); $venue = tribe_get_venue($entry->ID); $output .= "<a href='{$link}' class='{$class}'>"; if ($image) { $output .= $image; } $output .= "<div class='av-upcoming-event-data'>"; $output .= "<h4 title='av-upcoming-event-title'>{$title}</h4>"; $output .= "<div class='av-upcoming-event-meta'>"; $output .= "<span class='av-upcoming-event-schedule'>" . tribe_events_event_schedule_details($entry) . "</span>"; if ($price) { $output .= "<span class='av-upcoming-event-cost'>{$price}</span>"; } if ($price && $venue) { $output .= " - "; } if ($venue) { $output .= "<span class='av-upcoming-event-venue'>{$venue}</span>"; } $output .= apply_filters('avf_upcoming_event_extra_data', "", $entry); $output .= "</div>"; $output .= "</div>"; $output .= "</a>"; } if ($atts['paginate'] == "yes" && ($avia_pagination = avia_pagination($posts->max_num_pages, 'nav'))) { $output .= "<div class='pagination-wrap pagination-" . TribeEvents::POSTTYPE . "'>{$avia_pagination}</div>"; } $output .= "</div>"; } return $output; }
/** * Fetch and return required events. * @param array $atts shortcode attributes * @return string shortcode output */ public function ecs_fetch_events($atts) { /** * Check if events calendar plugin method exists */ if (!function_exists('tribe_get_events')) { return; } global $wp_query, $post; $output = ''; $atts = shortcode_atts(apply_filters('ecs_shortcode_atts', array('cat' => '', 'month' => '', 'limit' => 5, 'eventdetails' => 'true', 'time' => null, 'past' => null, 'venue' => 'false', 'author' => null, 'message' => 'There are no upcoming events at this time.', 'key' => 'End Date', 'order' => 'ASC', 'viewall' => 'false', 'excerpt' => 'false', 'thumb' => 'false', 'thumbwidth' => '', 'thumbheight' => '', 'contentorder' => apply_filters('ecs_default_contentorder', 'title, thumbnail, excerpt, date, venue', $atts), 'event_tax' => ''), $atts), $atts, 'ecs-list-events'); // Category if ($atts['cat']) { if (strpos($atts['cat'], ",") !== false) { $atts['cats'] = explode(",", $atts['cat']); $atts['cats'] = array_map('trim', $atts['cats']); } else { $atts['cats'] = $atts['cat']; } $atts['event_tax'] = array('relation' => 'OR', array('taxonomy' => 'tribe_events_cat', 'field' => 'name', 'terms' => $atts['cats']), array('taxonomy' => 'tribe_events_cat', 'field' => 'slug', 'terms' => $atts['cats'])); } // Past Event $meta_date_compare = '>='; $meta_date_date = current_time('Y-m-d H:i:s'); if ($atts['time'] == 'past' || !empty($atts['past'])) { $meta_date_compare = '<'; } // Key if (str_replace(' ', '', trim(strtolower($atts['key']))) == 'startdate') { $atts['key'] = '_EventStartDate'; } else { $atts['key'] = '_EventEndDate'; } // Date $atts['meta_date'] = array(array('key' => $atts['key'], 'value' => $meta_date_date, 'compare' => $meta_date_compare, 'type' => 'DATETIME')); // Specific Month if ($atts['month'] == 'current') { $atts['month'] = date('Y-m'); } if ($atts['month']) { $month_array = explode("-", $atts['month']); $month_yearstr = $month_array[0]; $month_monthstr = $month_array[1]; $month_startdate = date("Y-m-d", strtotime($month_yearstr . "-" . $month_monthstr . "-01")); $month_enddate = date("Y-m-01", strtotime("+1 month", strtotime($month_startdate))); $atts['meta_date'] = array(array('key' => $atts['key'], 'value' => array($month_startdate, $month_enddate), 'compare' => 'BETWEEN', 'type' => 'DATETIME')); } $posts = tribe_get_events(apply_filters('ecs_get_events_args', array('post_status' => 'publish', 'hide_upcoming' => true, 'posts_per_page' => $atts['limit'], 'tax_query' => $atts['event_tax'], 'meta_key' => $atts['key'], 'orderby' => 'meta_value', 'author' => $atts['author'], 'order' => $atts['order'], 'meta_query' => array($atts['meta_date'])), $atts)); if ($posts) { $output .= apply_filters('ecs_start_tag', '<ul class="ecs-event-list">', $atts); $atts['contentorder'] = explode(',', $atts['contentorder']); foreach ($posts as $post) { setup_postdata($post); $output .= apply_filters('ecs_event_start_tag', '<li class="ecs-event">', $atts, $post); // Put Values into $output foreach (apply_filters('ecs_event_contentorder', $atts['contentorder'], $atts, $post) as $contentorder) { switch (trim($contentorder)) { case 'title': $output .= apply_filters('ecs_event_title_tag_start', '<h4 class="entry-title summary">', $atts, $post) . '<a href="' . tribe_get_event_link() . '" rel="bookmark">' . apply_filters('ecs_event_list_title', get_the_title(), $atts, $post) . '</a>' . apply_filters('ecs_event_title_tag_end', '</h4>', $atts, $post); break; case 'thumbnail': if (self::isValid($atts['thumb'])) { $thumbWidth = is_numeric($atts['thumbwidth']) ? $atts['thumbwidth'] : ''; $thumbHeight = is_numeric($atts['thumbheight']) ? $atts['thumbheight'] : ''; if (!empty($thumbWidth) && !empty($thumbHeight)) { $output .= apply_filters('ecs_event_thumbnail', get_the_post_thumbnail(get_the_ID(), apply_filters('ecs_event_thumbnail_size', array($thumbWidth, $thumbHeight), $atts, $post)), $atts, $post); } else { if ($thumb = get_the_post_thumbnail(get_the_ID(), apply_filters('ecs_event_thumbnail_size', 'medium', $atts, $post))) { $output .= apply_filters('ecs_event_thumbnail_link_start', '<a href="' . tribe_get_event_link() . '">', $atts, $post); $output .= apply_filters('ecs_event_thumbnail', $thumb, $atts, $post); $output .= apply_filters('ecs_event_thumbnail_link_end', '</a>', $atts, $post); } } } break; case 'excerpt': if (self::isValid($atts['excerpt'])) { $excerptLength = is_numeric($atts['excerpt']) ? $atts['excerpt'] : 100; $output .= apply_filters('ecs_event_excerpt_tag_start', '<p class="ecs-excerpt">', $atts, $post) . apply_filters('ecs_event_excerpt', self::get_excerpt($excerptLength), $atts, $post) . apply_filters('ecs_event_excerpt_tag_end', '</p>', $atts, $post); } break; case 'date': if (self::isValid($atts['eventdetails'])) { $output .= apply_filters('ecs_event_date_tag_start', '<span class="duration time">', $atts, $post) . apply_filters('ecs_event_list_details', tribe_events_event_schedule_details(), $atts, $post) . apply_filters('ecs_event_date_tag_end', '</span>', $atts, $post); } break; case 'venue': if (self::isValid($atts['venue'])) { $output .= apply_filters('ecs_event_venue_tag_start', '<span class="duration venue">', $atts, $post) . apply_filters('ecs_event_venue_at_tag_start', '<em> ', $atts, $post) . apply_filters('ecs_event_venue_at_text', __('at', 'the-events-calendar-shortcode'), $atts, $post) . apply_filters('ecs_event_venue_at_tag_end', ' </em>', $atts, $post) . apply_filters('ecs_event_list_venue', tribe_get_venue(), $atts, $post) . apply_filters('ecs_event_venue_tag_end', '</span>', $atts, $post); } break; case 'date_thumb': if (self::isValid($atts['eventdetails'])) { $output .= apply_filters('ecs_event_date_thumb', '<div class="date_thumb"><div class="month">' . tribe_get_start_date(null, false, 'M') . '</div><div class="day">' . tribe_get_start_date(null, false, 'j') . '</div></div>', $atts, $post); } break; default: $output .= apply_filters('ecs_event_list_output_custom', '', trim($contentorder), $atts, $post); } } $output .= apply_filters('ecs_event_end_tag', '</li>', $atts, $post); } $output .= apply_filters('ecs_end_tag', '</ul>', $atts); if (self::isValid($atts['viewall'])) { $output .= apply_filters('ecs_view_all_events_tag_start', '<span class="ecs-all-events">', $atts) . '<a href="' . apply_filters('ecs_event_list_viewall_link', tribe_get_events_link(), $atts) . '" rel="bookmark">' . translate('View All Events', 'tribe-events-calendar') . '</a>'; $output .= apply_filters('ecs_view_all_events_tag_end', '</span>'); } } else { //No Events were Found $output .= apply_filters('ecs_no_events_found_message', translate($atts['message'], 'tribe-events-calendar'), $atts); } // endif wp_reset_query(); return $output; }
<article class="single-event vevent hentry"> <?php krafit_event_meta_cats(); ?> <?php // Event Titel the_title('<h1 class="tribe-events-single-event-title summary entry-title">', '</h1>'); ?> <div class="tribe-events-schedule updated published tribe-clearfix"> <?php // Event Details - Datum u. Uhrzeit echo tribe_events_event_schedule_details($event_id, '<span class="duration time">', '</span>'); ?> </div> <!-- Event header --> <div id="tribe-events-header" <?php tribe_events_the_header_attributes(); ?> > </div> <!-- #tribe-events-header --> <?php while (have_posts()) {
/** * Render the shortcode * @param array $args Shortcode paramters * @param string $content Content between shortcode * @return string HTML output */ function render($args, $content = '') { $defaults = shortcode_atts(array('class' => '', 'id' => '', 'cat_slug' => '', 'number_posts' => '4', 'columns' => '4', 'picture_size' => 'cover'), $args); extract($defaults); $html = ''; $args = array('post_type' => 'tribe_events', 'posts_per_page' => $number_posts); if ($cat_slug) { $terms = explode(',', $cat_slug); $args['tax_query'] = array(array('taxonomy' => 'tribe_events_cat', 'field' => 'slug', 'terms' => array_map('trim', $terms))); } switch ($columns) { case '1': $column_class = 'full-one'; break; case '2': $column_class = 'one-half'; break; case '3': $column_class = 'one-third'; break; case '4': $column_class = 'one-fourth'; break; case '5': $column_class = 'one-fifth'; break; case '6': $column_class = 'one-sixth'; break; } $events = new WP_Query($args); if ($events->have_posts()) { if ($id) { $id = ' id="' . $id . '"'; } $html .= '<div class="fusion-events-shortcode ' . $class . '"' . $id . '>'; $i = 1; $last = false; $columns = (int) $columns; while ($events->have_posts()) { $events->the_post(); if ($i == $columns) { $last = true; } if ($i > $columns) { $i = 1; $last = false; } if ($columns == 1) { $last = true; } $html .= '<div class="fusion-' . $column_class . ' fusion-spacing-yes fusion-layout-column ' . ($last ? 'fusion-column-last' : '') . '">'; $html .= '<div class="fusion-column-wrapper">'; $thumb_id = get_post_thumbnail_id(); $thumb_link = wp_get_attachment_image_src($thumb_id, 'full', true); $thumb_url = has_post_thumbnail(get_the_ID()) ? $thumb_link[0] : esc_url(trailingslashit(Tribe__Events__Pro__Main::instance()->pluginUrl) . 'src/resources/images/tribe-related-events-placeholder.png'); $img_class = has_post_thumbnail(get_the_ID()) ? '' : 'fusion-events-placeholder'; $thumb_img = '<img class="' . $img_class . '" src="' . $thumb_url . '" alt="' . esc_attr(get_the_title(get_the_ID())) . '" />'; $thumb_bg = '<span class="tribe-events-event-image" style="background-image: url(' . $thumb_url . '); -webkit-background-size: cover; background-size: cover; background-position: center center;"></span>'; $html .= '<div class="fusion-events-thumbnail hover-type-' . Avada()->settings->get('ec_hover_type') . '">'; $html .= '<a href="' . get_the_permalink() . '" class="url" rel="bookmark">'; if ($picture_size == 'auto') { $html .= $thumb_img; } else { $html .= $thumb_bg; } $html .= '</a>'; $html .= '</div>'; $html .= '<div class="fusion-events-meta">'; $html .= '<h2><a href="' . get_the_permalink() . '" class="url" rel="bookmark">' . get_the_title() . '</a></h2>'; $html .= '<h4>' . tribe_events_event_schedule_details() . '</h4>'; $html .= '</div>'; $html .= '</div>'; $html .= '</div>'; if ($last) { $html .= '<div class="fusion-clearfix"></div>'; } $i++; } $html .= '<div class="fusion-clearfix"></div>'; $html .= '</div>'; } return $html; }
} ?> <ul class="tribe-venue-widget-list"> <?php foreach ($events as $event) { ?> <li> <h4><a href="<?php echo get_permalink($event); ?> "><?php echo get_the_title($event->ID); ?> </a></h4> <?php echo tribe_events_event_schedule_details($event->ID); ?> <?php if (tribe_get_cost($event->ID) != '') { ?> <span class="tribe-events-divider">|</span> <span class="tribe-events-event-cost"> <?php echo tribe_get_cost($event->ID, true); ?> </span> <?php } ?> </li>
/** * Fetch and return required events. * @param array $atts shortcode attributes * @return string shortcode output */ public function ecs_fetch_events($atts) { /** * Check if events calendar plugin method exists */ if (!function_exists('tribe_get_events')) { return; } global $wp_query, $post; $output = ''; $ecs_event_tax = ''; extract(shortcode_atts(array('cat' => '', 'month' => '', 'limit' => 5, 'eventdetails' => 'true', 'time' => null, 'past' => null, 'venue' => 'false', 'author' => null, 'message' => 'There are no upcoming events at this time.', 'key' => 'End Date', 'order' => 'ASC', 'viewall' => 'false', 'excerpt' => 'false', 'thumb' => 'false', 'thumbwidth' => '', 'thumbheight' => '', 'contentorder' => 'title, thumbnail, excerpt, date, venue'), $atts, 'ecs-list-events'), EXTR_PREFIX_ALL, 'ecs'); // Category if ($ecs_cat) { $ecs_cats = explode(",", $ecs_cat); $ecs_cats = array_map('trim', $ecs_cats); $ecs_event_tax = array(array('taxonomy' => 'tribe_events_cat', 'field' => 'slug', 'terms' => $ecs_cat)); } // Past Event $meta_date_compare = '>='; $meta_date_date = date('Y-m-d'); if ($ecs_time == 'past' || !empty($ecs_past)) { $meta_date_compare = '<'; } // Key if (str_replace(' ', '', trim(strtolower($ecs_key))) == 'startdate') { $ecs_key = '_EventStartDate'; } else { $ecs_key = '_EventEndDate'; } // Date $ecs_meta_date = array(array('key' => $ecs_key, 'value' => $meta_date_date, 'compare' => $meta_date_compare, 'type' => 'DATETIME')); // Specific Month if ($ecs_month == 'current') { $ecs_month = date('Y-m'); } if ($ecs_month) { $month_array = explode("-", $ecs_month); $month_yearstr = $month_array[0]; $month_monthstr = $month_array[1]; $month_startdate = date($month_yearstr . "-" . $month_monthstr . "-1"); $month_enddate = date($month_yearstr . "-" . $month_monthstr . "-t"); $ecs_meta_date = array(array('key' => $ecs_key, 'value' => array($month_startdate, $month_enddate), 'compare' => 'BETWEEN', 'type' => 'DATETIME')); } $posts = get_posts(array('post_type' => 'tribe_events', 'posts_per_page' => $ecs_limit, 'tax_query' => $ecs_event_tax, 'meta_key' => $ecs_key, 'orderby' => 'meta_value', 'author' => $ecs_author, 'order' => $ecs_order, 'meta_query' => array($ecs_meta_date))); if ($posts) { $output .= '<ul class="ecs-event-list">'; $ecs_contentorder = explode(',', $ecs_contentorder); foreach ($posts as $post) { setup_postdata($post); $output .= '<li class="ecs-event">'; // Put Values into $output foreach ($ecs_contentorder as $contentorder) { switch (trim($contentorder)) { case 'title': $output .= '<h4 class="entry-title summary">' . '<a href="' . tribe_get_event_link() . '" rel="bookmark">' . get_the_title() . '</a> </h4>'; break; case 'thumbnail': if (self::isValid($ecs_thumb)) { $thumbWidth = is_numeric($ecs_thumbwidth) ? $ecs_thumbwidth : ''; $thumbHeight = is_numeric($ecs_thumbheight) ? $ecs_thumbheight : ''; if (!empty($thumbWidth) && !empty($thumbHeight)) { $output .= get_the_post_thumbnail(get_the_ID(), array($thumbWidth, $thumbHeight)); } else { $output .= get_the_post_thumbnail(get_the_ID(), 'medium'); } } break; case 'excerpt': if (self::isValid($ecs_excerpt)) { $excerptLength = is_numeric($ecs_excerpt) ? $ecs_excerpt : 100; $output .= '<p class="ecs-excerpt">' . self::get_excerpt($excerptLength) . '</p>'; } break; case 'date': if (self::isValid($ecs_eventdetails)) { $output .= '<span class="duration time">' . tribe_events_event_schedule_details() . '</span>'; } break; case 'venue': if (self::isValid($ecs_venue)) { $output .= '<span class="duration venue"><em> at </em>' . tribe_get_venue() . '</span>'; } break; } } $output .= '</li>'; } $output .= '</ul>'; if (self::isValid($ecs_viewall)) { $output .= '<span class="ecs-all-events"><a href="' . tribe_get_events_link() . '" rel="bookmark">' . translate('View All Events', 'tribe-events-calendar') . '</a></span>'; } } else { //No Events were Found $output .= translate($ecs_message, 'tribe-events-calendar'); } // endif wp_reset_query(); return $output; }
do_action('tribe_events_before_the_meta'); ?> <div class="tribe-events-event-meta"> <div class="updated published time-details"> <?php if (!empty($post->distance)) { ?> <strong>[<?php echo tribe_get_distance_with_unit($post->distance); ?> ]</strong> <?php } ?> <?php echo tribe_events_event_schedule_details(), tribe_events_event_recurring_info_tooltip(); ?> </div> </div><!-- .tribe-events-event-meta --> <?php do_action('tribe_events_after_the_meta'); ?> <!-- Event Content --> <?php do_action('tribe_events_before_the_content'); ?> <div class="tribe-events-list-photo-description tribe-events-content entry-summary description"> <?php echo tribe_events_get_the_excerpt(); ?>
/** * Fetch and return required events. * @param array $atts shortcode attributes * @return string shortcode output */ public function ecs_fetch_events($atts) { /** * Check if events calendar plugin method exists */ if (!function_exists('tribe_get_events')) { return; } global $wp_query, $post; $output = ''; $atts = shortcode_atts(array('cat' => '', 'month' => '', 'limit' => 5, 'eventdetails' => 'true', 'time' => null, 'past' => null, 'venue' => 'false', 'author' => null, 'message' => sprintf(__('There are no upcoming %s at this time.', 'tribe-events-calendar'), tribe_get_event_label_plural()), 'key' => 'End Date', 'order' => 'ASC', 'viewall' => 'false', 'excerpt' => 'false', 'thumb' => 'false', 'thumbwidth' => '', 'thumbheight' => '', 'contentorder' => 'title, thumbnail, excerpt, date, venue', 'event_tax' => ''), $atts, 'ecs-list-events'); // Category if ($atts['cat']) { if (strpos($atts['cat'], ",") !== false) { $atts['cats'] = explode(",", $atts['cat']); $atts['cats'] = array_map('trim', $atts['cats']); } else { $atts['cats'] = $atts['cat']; } $atts['event_tax'] = array('relation' => 'OR', array('taxonomy' => 'tribe_events_cat', 'field' => 'name', 'terms' => $atts['cats']), array('taxonomy' => 'tribe_events_cat', 'field' => 'slug', 'terms' => $atts['cats'])); } // Past Event $meta_date_compare = '>='; $meta_date_date = date('Y-m-d'); if ($atts['time'] == 'past' || !empty($atts['past'])) { $meta_date_compare = '<'; } // Key if (str_replace(' ', '', trim(strtolower($atts['key']))) == 'startdate') { $atts['key'] = '_EventStartDate'; } else { $atts['key'] = '_EventEndDate'; } // Date $atts['meta_date'] = array(array('key' => $atts['key'], 'value' => $meta_date_date, 'compare' => $meta_date_compare, 'type' => 'DATETIME')); // Specific Month if ($atts['month'] == 'current') { $atts['month'] = date('Y-m'); } if ($atts['month']) { $month_array = explode("-", $atts['month']); $month_yearstr = $month_array[0]; $month_monthstr = $month_array[1]; $month_startdate = date($month_yearstr . "-" . $month_monthstr . "-1"); $month_enddate = date($month_yearstr . "-" . $month_monthstr . "-t"); $atts['meta_date'] = array(array('key' => $atts['key'], 'value' => array($month_startdate, $month_enddate), 'compare' => 'BETWEEN', 'type' => 'DATETIME')); } $posts = get_posts(array('post_type' => 'tribe_events', 'posts_per_page' => $atts['limit'], 'tax_query' => $atts['event_tax'], 'meta_key' => $atts['key'], 'orderby' => 'meta_value', 'author' => $atts['author'], 'order' => $atts['order'], 'meta_query' => array($atts['meta_date']))); if ($posts) { $output .= '<ul class="ecs-event-list">'; $atts['contentorder'] = explode(',', $atts['contentorder']); foreach ($posts as $post) { setup_postdata($post); $li_classes = 'ecs-event'; $start_date = tribe_get_start_date($post, false, 'Y-m-d'); $today = date('Y-m-d', current_time('timestamp')); $tomorrow = date('Y-m-d', strtotime('tomorrow', current_time('timestamp'))); if ($start_date == $today) { $li_classes .= ' ecs-today'; } else { if ($start_date == $tomorrow) { $li_classes .= ' ecs-tomorrow'; } } $output .= '<li class="' . $li_classes . '">'; // Put Values into $output foreach ($atts['contentorder'] as $contentorder) { switch (trim($contentorder)) { case 'title': $output .= '<h4 class="entry-title summary">' . '<a href="' . tribe_get_event_link() . '" rel="bookmark">' . apply_filters('ecs_event_list_title', get_the_title(), $atts) . '</a> </h4>'; break; case 'thumbnail': if (self::isValid($atts['thumb'])) { $thumbWidth = is_numeric($atts['thumbwidth']) ? $atts['thumbwidth'] : ''; $thumbHeight = is_numeric($atts['thumbheight']) ? $atts['thumbheight'] : ''; if (!empty($thumbWidth) && !empty($thumbHeight)) { $output .= get_the_post_thumbnail($post->ID, array($thumbWidth, $thumbHeight)); } else { $size = !empty($thumbWidth) && !empty($thumbHeight) ? array($thumbWidth, $thumbHeight) : 'medium'; if ($thumb = get_the_post_thumbnail($post->ID, $size)) { $output .= '<a href="' . tribe_get_event_link() . '">'; $output .= $thumb; $output .= '</a>'; } } } break; case 'excerpt': if (self::isValid($atts['excerpt'])) { $excerptLength = is_numeric($atts['excerpt']) ? $atts['excerpt'] : 100; $output .= '<p class="ecs-excerpt">' . self::get_excerpt($excerptLength) . '</p>'; } break; case 'date': if (self::isValid($atts['eventdetails'])) { $output .= '<span class="duration time">' . apply_filters('ecs_event_list_details', tribe_events_event_schedule_details(), $atts) . '</span>'; } break; case 'venue': if (self::isValid($atts['venue'])) { $output .= '<span class="duration venue">' . apply_filters('ecs_event_list_venue', ' <em>at</em> ' . tribe_get_venue(), $atts) . '</span>'; } break; } } $output .= '</li>'; } $output .= '</ul>'; if (self::isValid($atts['viewall'])) { $output .= '<span class="ecs-all-events"><a href="' . apply_filters('ecs_event_list_viewall_link', tribe_get_events_link(), $atts) . '" rel="bookmark">' . translate(apply_filters('ecs_event_list_viewall_text', 'View All Events', $atts), 'tribe-events-calendar') . '</a></span>'; } } else { //No Events were Found $output .= translate($atts['message'], 'tribe-events-calendar'); } // endif wp_reset_query(); return $output; }
* @author Modern Tribe Inc. * */ if (!defined('ABSPATH')) { die('-1'); } //Maximum Number of related posts to display $num_posts = 3; $posts = tribe_get_related_posts($num_posts); ?> <?php if (is_array($posts) && !empty($posts)) { echo '<h3 class="tribe-events-related-events-title">' . __('Related Events', 'tribe-events-calendar-pro') . '</h3>'; echo '<ul class="tribe-related-events tribe-clearfix hfeed vcalendar">'; foreach ($posts as $post) { echo '<li>'; $thumb = has_post_thumbnail($post->ID) ? get_the_post_thumbnail($post->ID, 'large') : '<img src="' . trailingslashit(TribeEventsPro::instance()->pluginUrl) . 'resources/images/tribe-related-events-placeholder.png" alt="' . get_the_title($post->ID) . '" />'; echo '<div class="tribe-related-events-thumbnail">'; echo '<a href="' . tribe_get_event_link($post) . '" class="url" rel="bookmark">' . $thumb . '</a>'; echo '</div>'; echo '<div class="tribe-related-event-info">'; echo '<h3 class="tribe-related-events-title summary"><a href="' . tribe_get_event_link($post) . '" class="url" rel="bookmark">' . get_the_title($post->ID) . '</a></h3>'; if ($post->post_type == TribeEvents::POSTTYPE) { echo tribe_events_event_schedule_details($post); } echo '</div>'; echo '</li>'; } echo '</ul>'; }
$events_label_plural = tribe_get_event_label_plural(); $event_id = get_the_ID(); ?> <div id="tribe-events-content" class="tribe-events-single vevent hentry"> <!-- Notices --> <?php tribe_events_the_notices(); ?> <?php the_title('<h3 class="single-event-title">', '</h3>'); ?> <?php echo tribe_events_event_schedule_details($event_id, '<h3 class="single-event-date">', '</h3>'); ?> <!-- Event header --> <div id="tribe-events-header" <?php tribe_events_the_header_attributes(); ?> > <!-- Navigation --> <h3 class="tribe-events-visuallyhidden"><?php printf(__('%s Navigation', 'tribe-events-calendar'), $events_label_singular); ?> </h3> <!-- .tribe-events-sub-nav --> </div> <!-- #tribe-events-header -->
/** * Echos the single events page related events boxes. * * @param mixed $tag The specific tags you want it relating to. * @param mixed $category The specific categories you want it relating to. * @param int $count The number of related events to find. * @param mixed $blog What blog/site should they come from? * @param bool $only_display_related Should we show only related events if we don't find $count number of related ones? * @param string $post_type What post type are we finding related things in? * @return void. */ function tribe_single_related_events($tag = false, $category = false, $count = 3, $blog = false, $only_display_related = true, $post_type = TribeEvents::POSTTYPE) { $posts = tribe_get_related_posts($tag, $category, $count, $blog, $only_display_related, $post_type); if (is_array($posts) && !empty($posts)) { echo '<h3 class="tribe-events-related-events-title">' . __('Related Events', 'tribe-events-calendar-pro') . '</h3>'; echo '<ul class="tribe-related-events tribe-clearfix hfeed vcalendar">'; foreach ($posts as $post) { echo '<li>'; $thumb = has_post_thumbnail($post->ID) ? get_the_post_thumbnail($post->ID, 'large') : '<img src="' . trailingslashit(TribeEventsPro::instance()->pluginUrl) . 'resources/images/tribe-related-events-placeholder.png" alt="' . get_the_title($post->ID) . '" />'; echo '<div class="tribe-related-events-thumbnail">'; echo '<a href="' . get_permalink($post->ID) . '" class="url" rel="bookmark">' . $thumb . '</a>'; echo '</div>'; echo '<div class="tribe-related-event-info">'; echo '<h3 class="tribe-related-events-title summary"><a href="' . get_permalink($post->ID) . '" class="url" rel="bookmark">' . get_the_title($post->ID) . '</a></h3>'; if (class_exists('TribeEvents') && $post->post_type == TribeEvents::POSTTYPE && function_exists('tribe_events_event_schedule_details')) { echo tribe_events_event_schedule_details($post); } if (class_exists('TribeEvents') && $post->post_type == TribeEvents::POSTTYPE && function_exists('tribe_events_event_recurring_info_tooltip')) { echo tribe_events_event_recurring_info_tooltip($post->ID); } echo '</div>'; echo '</li>'; } echo '</ul>'; } }
<?php $event_id = $event->ID; ?> <div class="single-event-popup <?php echo tribe_events_event_classes( $event_id ); ?>"> <div class="col-sm-4"> <?php echo tribe_event_featured_image( $event_id, 'event-popup', false ); ?> </div> <div class="col-sm-8"> <h2 class="event-title"><?php echo $event->post_title; ?></h2> <?php echo apply_filters( 'the_content', $event->post_content ); ?> <ul class="meta-info"> <li><label>What:</label> <?php echo $event->post_title; ?></li> <li><label>When:</label> <?php echo tribe_events_event_schedule_details( $event_id ); ?></li> <?php if ( tribe_address_exists( $event_id ) ) : ?> <li><label>Where:</label> <?php echo tribe_get_full_address( $event_id ); ?></li> <?php endif; ?> <li><label>Cost:</label> <?php echo get_post_meta( $event_id, '_ecp_custom_2', true ); ?></li> <?php if ( tribe_has_organizer( $event_id ) ): ?> <li><label>Info:</label> <a href="mailto:<?php echo tribe_get_organizer_email( $event_id ); ?>"><?php echo tribe_get_organizer_email( $event_id ); ?></a></li> <?php endif; ?> <li><label>Register:</label> <?php echo get_post_meta( $event_id, '_ecp_custom_5', true ); ?></li> </ul> <?php echo bones_get_edit_link( $event_id ); ?> </div> </div>
<?php tribe_events_the_notices(); ?> <!-- Event featured image, but exclude link --> <?php echo tribe_event_featured_image($event_id, 'full', false); ?> <?php the_title('<h2 class="border-title"><span>', '</span></h2>'); ?> <div class="tribe-events-schedule updated published tribe-clearfix"> <?php echo tribe_events_event_schedule_details($event_id, '<h3>', '</h3>'); ?> <?php if (tribe_get_cost()) { ?> <span class="tribe-events-divider">|</span> <span class="tribe-events-cost"><?php echo tribe_get_cost(null, true); ?> </span> <?php } ?> </div> <?php
/** * Prints Simple Title for single events */ function grve_print_event_simple_title($event_id) { $event_style = grve_option('event_style', 'default'); if ('simple' == $event_style) { ?> <div class="grve-event-title-wrapper"> <h1 class="grve-post-simple-title"><span><?php the_title(); ?> </span></h1> <a class="grve-events-backlink" href="<?php echo tribe_get_events_link(); ?> "><i class="grve-icon-th-large"></i><?php _e('All Events', GRVE_THEME_TRANSLATE); ?> </a> </div> <h5 id="grve-meta-event-simple-style"> <?php echo tribe_events_event_schedule_details($event_id, '', ''); if (tribe_get_cost()) { ?> <span class="grve-events-divider">|</span> <span class="grve-event-cost grve-color-primary-1"><?php echo tribe_get_cost(null, true); ?> </span> <?php } ?> </h5> <?php } }