Support » Plugin: The Events Calendar » [Plugin: The Events Calendar] The NEXT three events in the widget

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Rob La Gatta

    (@roblagatta)

    Hey jrgreenfield1. Any chance using template tags could help you out? We’ve detailed those in some depth at our Documentation page: http://tri.be/support/documentation/.

    Let me know if that’s not as specific as what you’re looking for, and we’ll do what we can to assist. Thanks!

    Hi Rob, It’s not I don’t think. I’m using the following code currently which uses the template tag tribe_get_events, but for some reason the ‘upcoming’ aren’t displaying the next three. I tried displaying using the widget and that displays the same ‘non next 3’ events. Any suggestions?

    <?php global $post;
    $upcoming = tribe_get_events( array('eventDisplay'=>'upcoming', 'posts_per_page'=>3) );
    foreach($upcoming as $post) : setup_postdata($post);
    
    echo '<h3 class="clearfix"><a href="';
    the_permalink();
    echo '">';
    the_title();
    echo '</a></h3>';
    
    if ( has_post_thumbnail() ) {
          echo '<a href="';
          the_permalink();
          echo '"><div style="float:left;margin:0 10px 10px 0;" >';
          the_post_thumbnail('thumbnail');
          echo '</div></a>';
          the_excerpt();
         } else {
          echo the_excerpt();
          }
    
    endforeach; ?>

    I’m having a similar issue, except I’m trying to just get the next ONE event, rather than three. It doesn’t seem to be pulling events in the right order…

    Hmm… I had a similar issue, but here’s the code that worked for me finally:

    global $post;
        $events = tribe_get_events(array(
                'eventDisplay'=>'upcoming',
                'posts_per_page'=>1
        ));      
    
        foreach($events as $post) { setup_postdata($post);
        echo '<a href="/events/">'.get_the_title().'<span>'.tribe_get_start_date($post->ID, false, 'M j').'</span></a>';
        }
        wp_reset_query();
    Plugin Author Rob La Gatta

    (@roblagatta)

    Thanks for confirming, Trevor.

    JRGreenfield: Any chance Trevor’s code got you where you need to be, or at least pointed you in the right direction? Let me know if not and I can get someone on our team looking into this.

    Hi Rob and Trevor –
    Sorry it’s taken so long for me to get back– Had a baby boy on Tuesday.

    No dice on that code. I just can’t figure this one out! I’m wondering if it has to do with the upgrade and import of old calendar items.

    BTW – Rob, thanks for being so on top of support. Your involvement and responsiveness is appreciated.

    Plugin Author Rob La Gatta

    (@roblagatta)

    Congrats on the baby, JRgreenfield! That’s exciting. Thanks for the words, too 🙂

    As for this issue: since it’s continuing to present itself as a problem, I’m going to get a dev on our end to respond here. I’ve passed this on to the team so hopefully we can get a response here over the next couple days. Apologies for the inconvenience in the interim.

    Hi Rob-
    Thanks! I think my “wringer developer” (plug for him – Mike at cfxdesign.com) solved it and he thought that it was an error in the plugin itself. He mentioned that he submitted it to you guys so keep an eye out for it. Thanks again!

    Plugin Author Rob La Gatta

    (@roblagatta)

    Oh, awesome to hear. Thanks for confirming – did Mike say whether he’d emailed that or posted on the forum? Want to make sure we don’t lose it.

    You can try this, it worked for me!

    <?php $loop = new WP_Query( array( 'post_type' => 'tribe_events', 'posts_per_page' => 2 ) ); ?>
    					<?php while ( $loop->have_posts() ) : $loop->the_post(); ?>
    					<?php get_post_meta($post->ID, 'events', true); ?>
    					<?php endwhile; ?>
    						<!----Upcoming Events---->
    						<?php global $post;
    						$upcoming = tribe_get_events( array('eventDisplay'=>'upcoming', 'posts_per_page'=>2  ) );
    						foreach($upcoming as $post) : setup_postdata($post);
    							//post title
    							echo '<div class=" event-post-thumb"><h4><a href="';
    							the_permalink();
    							echo '">';
    							the_title();
    							echo '</h4>';
    
    							//post date
    							echo '<p>';
    							echo tribe_get_start_date( $post->ID, false, 'D. M j, Y' );
    							echo '</p>';
    
    							//post thumbnail and excerpt
    							if ( has_post_thumbnail() ) {
    								  echo '<a href="';the_permalink();echo '">
    								  <div class="" >';the_post_thumbnail('small-list-thumbnail');echo '</div></a>';
    								  echo '<div class="fr">';
    								  the_excerpt();} else {echo the_excerpt();
    								  echo '</div>';
    								  }
    						endforeach;
    						?>

    Plugin Author Rob La Gatta

    (@roblagatta)

    Awesome! Thanks for sharing. Would certainly be interested to hear if this solution did the trick for any other users who’d posted about this as well. Either of you guys able to give this a go?

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘[Plugin: The Events Calendar] The NEXT three events in the widget’ is closed to new replies.