Forum Replies Created
Viewing 2 posts - 1 through 2 (of 2 total)
-
AuthorPosts
-
Mitch
ParticipantHi Brian, I have compared single-event.php on the live site with the version from https://wordpress.org/plugins/the-events-calendar/. There are significant differences in the code as the existing developer appears to have adjusted the template.
The original source doesn’t appear to have reference to Google maps. I do have file comparison tools, and the next step would be for me to start cutting and pasting code from one to the other, however perhaps with the code shown below the issue may stand out to you assuming you are more familiar with how the events calendar works? Any help greatly appreciated 🙂
Code comparions below:
Custom
<?php /** * Single Event Template * A single event. This displays the event title, description, meta, and * optionally, the Google map for the event. * * Override this template in your own theme by creating a file at [your-theme]/tribe-events/single-event.php * * @package TribeEventsCalendar * @since 2.1 * @author Modern Tribe Inc. * */ if ( !defined('ABSPATH') ) { die('-1'); } $event_id = get_the_ID(); ?> <div class="body-container body-page"> <div class="container"> <div class="spacer40 visible-lg visible-md visible-sm"></div> <!-- <p class="tribe-events-back"><a href="<?php //echo tribe_get_events_link() ?>"> <?php //_e( '« All Events', 'tribe-events-calendar' ) ?></a></p> --> <!-- Notices --> <?php tribe_events_the_notices() ?> <div class="col-md-12"> <div class="event-title"> <div class="col-md-1 col-sm-2 col-xs-3 single-event-date"> <?php //$date = tribe_events_event_schedule_details( $event_id, '', ''); ?> <?php // $date = tribe_get_start_date(); // $patterns = array(); // $patterns[0] = '/,/'; // $replacements = array(); // $replacements[0] = ''; // $edate = preg_replace($patterns, $replacements, $date); // $pieces = explode(" ", $edate); // $m = $pieces[0]; // $emonth = substr($m, 0, 3); //echo $pieces[1]; // piece2 ?> <div class="date"> <div class="month"> <?php echo tribe_get_start_date( $post->ID, false, 'M' ); ?> </div> <div class="day"><?php echo tribe_get_start_date( $post->ID, false, 'd' ); ?> </div> </div> </div> <!-- <div class="padded-textgreen-left padded-lborder-w30 padded-marginb30 text-capitalize"> <h1 class="padded-font24"><strong><?php// the_title(); ?></strong></h1> </div> --> <div class="padded-textgreen-left padded-lborder-w20 padded-marginb10 text-capitalize pull-left"> <h1 class="padded-font24"><strong><?php the_title(); ?></strong></h1> </div> <div class="cf"></div> </div> </div> <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 endif; ?> </div> <!-- Event header --> <div id="tribe-events-header" <?php tribe_events_the_header_attributes() ?>> <!-- Navigation --> <h3 class="tribe-events-visuallyhidden"><?php _e( 'Event Navigation', 'tribe-events-calendar' ) ?></h3> <ul class="tribe-events-sub-nav"> <li class="tribe-events-nav-previous"><?php tribe_the_prev_event_link( '<span>«</span> %title%' ) ?></li> <li class="tribe-events-nav-next"><?php tribe_the_next_event_link( '%title% <span>»</span>' ) ?></li> </ul><!-- .tribe-events-sub-nav --> </div><!-- #tribe-events-header --> <?php while ( have_posts() ) : the_post(); ?> <div id="post-<?php the_ID(); ?>" <?php post_class('vevent event-individual-content content'); ?>> <div class="col-md-4 three-col first-col"> <!-- Event featured image --> <?php echo tribe_event_featured_image(); ?> <h2>Details</h2> <div class="table"> <div class="table-row"> <div class="table-cell"> <p><strong>Date:</strong></p> </div> <div class="table-cell"> <p><?php echo tribe_get_start_date( $post->ID, false, 'M d, Y' ); ?> </p> </div> </div> <div class="table-row"> <div class="table-cell"> <p><strong>Tags:</strong></p> </div> <div class="table-cell"> <p> <?php $posttags = get_the_tags(); $t= "No tags for this post."; if ($posttags) { foreach($posttags as $tag) { $tags .= $tag->name . ', '; } $t = substr($tags, 0, -2); echo $t; } ?> </p> </div> </div> <?php $wsite=tribe_get_event_website_link(); $wsite=trim($wsite); if(!empty($wsite) || $wsite !=''){ ?> <div class="table-row eventwsite"> <div class="table-cell"> <p><strong>Website:</strong></p> </div> <div class="table-cell"> <p><?php echo $wsite; ?></p> </div> </div> <?php } ?> </div> </div> <div class="col-md-4 three-col second-col"> <?php the_content(); ?> </div> <div class="col-md-4 three-col third-col"> <?php echo tribe_get_embedded_map($post_id, 100, 800, false); ?> <p><strong><a href="<?php echo tribe_get_map_link(); ?>" target="_blank">+ Google Map</a></strong></p> <span class="spacer20"></span> <h2>Venue</h2> <p> <?php $state=''; $ptermargs=array( 'slug' => 'event-locations', 'hide_empty' => false, ); $pterms=get_terms('tribe_events_cat',$ptermargs); $pterm_id=$pterms[0]->term_id; $posttax=get_the_terms( $post_id, 'tribe_events_cat' ); foreach($posttax as $pt){ if($pt->parent == $pterm_id){ $state=$pt->name; } } $venue=tribe_get_venue(); if(trim($venue)!='' && !empty($venue)){ echo $venue."<br />"; } $address=tribe_get_address(); if(trim($address)!='' && !empty($address)){ echo $address."<br />"; } $city= tribe_get_city(); //$state= tribe_get_stateprovince(); $csp=''; if(trim($city)!='' && !empty($city)){ $csp.=$city; } if(trim($state)!='' && !empty($state)){ if($csp!=''); $csp.=", ".$state; }else{ $csp.=$state; } echo $csp; ?> </p> </div> <?php // $catid = tribe_get_event_cat_ids(); // $catslug = tribe_get_event_cat_slugs($post_id); $tax= array(); $terms = get_the_terms( $post->id, 'tribe_events_cat' ); if ($terms) { foreach($terms as $t) { array_push($tax, $t->slug); } } //print_r($terms); //Returns Array of Term Names for "my_term" // $term_list = wp_get_post_terms($post->ID, 'tribe_events_cat', array("fields" => "slug")); // print_r($term_list); // $catslug = tribe_get_event_taxonomy(); // echo $catslug; // echo $post_id; // echo $catslug[$post_id]; // print_r($catslug); // print_r($catid); // echo 'Event link: '. tribe_event_link().'<br>'; // echo 'End Date: ' . tribe_get_end_date(). '<br>'; // echo 'address: '. tribe_get_address() . '<br>'; // echo 'City: ' . trit_city().be_ge '<br>'; // echo 'Cost: ' . tribe_get_cost(). '<br>'; // echo 'Country: ' . tribe_get_country(). '<br>'; // echo 'Google Map: ' . tribe_get_embedded_map(). '<br>'; // echo 'Map link: '. tribe_get_map_link().'<br>'; // // Organizer // echo 'Organizer: ' . tribe_get_organizer().'<br>'; // echo 'Organizer Email: ' . tribe_get_organizer_email().'<br>'; // echo 'Organizer Link: ' . tribe_get_organizer_link().'<br>'; // echo 'Organizer phone: ' . tribe_get_organizer_phone().'<br>'; // echo 'Organizer website: ' . tribe_get_organizer_website_url().'<br>'; // echo 'Organizer link: ' . tribe_get_organizer_website_link().'<br>'; // Venue ?> <?php do_action( 'tribe_events_single_event_after_the_meta' ) ?> </div><!-- .hentry .vevent --> <?php if( get_post_type() == TribeEvents::POSTTYPE && tribe_get_option( 'showComments', false ) ) comments_template() ?> <?php endwhile; ?> <!-- Event footer --> <div id="tribe-events-footer"> <!-- Navigation --> <!-- Navigation --> <h3 class="tribe-events-visuallyhidden"><?php _e( 'Event Navigation', 'tribe-events-calendar' ) ?></h3> <ul class="tribe-events-sub-nav"> <li class="tribe-events-nav-previous"><?php tribe_the_prev_event_link( '<span>«</span> %title%' ) ?></li> <li class="tribe-events-nav-next"><?php tribe_the_next_event_link( '%title% <span>»</span>' ) ?></li> </ul><!-- .tribe-events-sub-nav --> </div><!-- #tribe-events-footer --> <!-- Upcoming Events --> <div class="upcoming-event-circle cf"> <div class="col-md-12"> <div class="title"> <h1><i class="event-icon icon-size27"></i>UPCOMING <?php echo tribe_get_event_taxonomyc(); ?> EVENTS</h1> </div> </div> <div class="cf"></div> <?php global $post; $all_events = tribe_get_events( array( 'eventDisplay'=>'upcoming', 'posts_per_page'=>3, 'tax_query'=> array( array( 'taxonomy' => 'tribe_events_cat', 'field' => 'slug', 'terms' => $tax ) ) ) ); foreach($all_events as $post) { setup_postdata($post); ?> <div class="col-md-4 col-sm-4 col-xs-4 upcoming-events events-list circle-shape"> <a href="<?php the_permalink(); ?>"> <div class="img-con"> <?php $attachment_id = get_the_id(); wp_get_attachment_image_src( $attachment_id ); if( $image_attributes ) { $w = $image_attributes[1]; $h = $image_attributes[2]; } echo $h; echo $w; if ($h>$w) { the_post_thumbnail('circle-square', array('class' => 'wauto')); }elseif ($w>$h){ the_post_thumbnail('circle-square', array('class' => 'hauto')); }else { the_post_thumbnail('circle-square'); } ?> </div> <div class="col-md-3 col-sm-4 event-date"> <div class="date"> <div class="month"> <?php echo tribe_get_start_date( $post->ID, false, 'M' ); ?> </div> <div class="day"><?php echo tribe_get_start_date( $post->ID, false, 'd' ); ?> </div> </div> </div> <div class="col-md-9 col-sm-8 event-content"> <div class="event-details"> <div class="padded-textviolet-left padded-lborder-w20 padded-marginb18 text-uppercase"> <h3 class="padded-font18"><strong><?php the_title(); ?></strong></h3> </div> <p><strong><?php echo tribe_get_venue(); ?></strong></p> <p><?php the_excerpt(); ?></p> </div> </div> </a> </div> <?php } //endforeach ?> <?php wp_reset_query(); ?> </div> </div> </div> <script> jQuery(document).ready( function($){ var c=$(".us_cpt_top").clone(); console.log("content -> "+c); $(".us_cpt_top").remove(); $(".event-title").after(c); $(".us_cpt_top").css("margin-top","20px"); $(".us_cpt_top .us_wrapper.tac").css("text-align", "left"); }); </script>Origianl Source
<?php /** * Single Event Template * A single event. This displays the event title, description, meta, and * optionally, the Google map for the event. * * Override this template in your own theme by creating a file at [your-theme]/tribe-events/single-event.php * * @package TribeEventsCalendar * */ if ( ! defined( 'ABSPATH' ) ) { die( '-1' ); } $events_label_singular = tribe_get_event_label_singular(); $events_label_plural = tribe_get_event_label_plural(); $event_id = get_the_ID(); ?> <div id="tribe-events-content" class="tribe-events-single vevent hentry"> <p class="tribe-events-back"> <a href="<?php echo esc_url( tribe_get_events_link() ); ?>"> <?php printf( __( '« All %s', 'the-events-calendar' ), $events_label_plural ); ?></a> </p> <!-- Notices --> <?php tribe_events_the_notices() ?> <?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 endif; ?> </div> <!-- Event header --> <div id="tribe-events-header" <?php tribe_events_the_header_attributes() ?>> <!-- Navigation --> <h3 class="tribe-events-visuallyhidden"><?php printf( __( '%s Navigation', 'the-events-calendar' ), $events_label_singular ); ?></h3> <ul class="tribe-events-sub-nav"> <li class="tribe-events-nav-previous"><?php tribe_the_prev_event_link( '<span>«</span> %title%' ) ?></li> <li class="tribe-events-nav-next"><?php tribe_the_next_event_link( '%title% <span>»</span>' ) ?></li> </ul> <!-- .tribe-events-sub-nav --> </div> <!-- #tribe-events-header --> <?php while ( have_posts() ) : the_post(); ?> <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>> <!-- Event featured image, but exclude link --> <?php echo tribe_event_featured_image( $event_id, 'full', false ); ?> <!-- Event content --> <?php do_action( 'tribe_events_single_event_before_the_content' ) ?> <div class="tribe-events-single-event-description tribe-events-content entry-content description"> <?php the_content(); ?> </div> <!-- .tribe-events-single-event-description --> <?php do_action( 'tribe_events_single_event_after_the_content' ) ?> <!-- Event meta --> <?php do_action( 'tribe_events_single_event_before_the_meta' ) ?> <?php tribe_get_template_part( 'modules/meta' ); ?> <?php do_action( 'tribe_events_single_event_after_the_meta' ) ?> </div> <!-- #post-x --> <?php if ( get_post_type() == Tribe__Events__Main::POSTTYPE && tribe_get_option( 'showComments', false ) ) comments_template() ?> <?php endwhile; ?> <!-- Event footer --> <div id="tribe-events-footer"> <!-- Navigation --> <h3 class="tribe-events-visuallyhidden"><?php printf( __( '%s Navigation', 'the-events-calendar' ), $events_label_singular ); ?></h3> <ul class="tribe-events-sub-nav"> <li class="tribe-events-nav-previous"><?php tribe_the_prev_event_link( '<span>«</span> %title%' ) ?></li> <li class="tribe-events-nav-next"><?php tribe_the_next_event_link( '%title% <span>»</span>' ) ?></li> </ul> <!-- .tribe-events-sub-nav --> </div> <!-- #tribe-events-footer --> </div><!-- #tribe-events-content -->-
This reply was modified 10 years, 6 months ago by
Mitch.
Mitch
Participant@william thank you but that plugin doesn’t exist on my site.
Thank you Brian I will try this.
-
This reply was modified 10 years, 6 months ago by
-
AuthorPosts
Viewing 2 posts - 1 through 2 (of 2 total)
