Upcoming Events feed on home page showing incorrectly

Home Forums Calendar Products Events Calendar PRO Upcoming Events feed on home page showing incorrectly

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #992515
    Richard Schalin
    Participant

    Hello,

    On this site (http://austinboxerrescue.com) the Upcoming Events feed was not displaying events chronologically. Then we we tried to fix it, it would not show newly added events. Now it is bugged out even more and showing more than the requested 4 events. How can we fix this issue. BTW it also caused our bottom sidebar to disappear 🙁

    I cannot deactivate plugins because it is a client’s live site and I definitely cannot revert the theme to 2014.

    #992803
    George
    Participant

    Hey Michele,

    I’m sorry to hear about your issues! Can you clarify exactly what you mean when you write this:

    the Upcoming Events feed was not displaying events chronologically

    What do you mean by “Chronologically”? Do you mean that an event that would start on August 20th, for example, was showing higher up on the page than an event that started on, say, August 10th?

    Or do you mean something else?

    If my example above is what you found, then unfortunately doing theme/plugin deactivation tests, or at the least allowing errors to print on your site are the best steps we can start with for troubleshooting. I know how annoying it can be to do this on a live site – and hopefully we can avoid those steps! But let me know a bit more about the nature of your order problem itself, and what exactly you mean by “Chronological order” – we can continue from there.

    Thank you!
    George

    #992806
    George
    Participant

    (P.S. – For what it’s worth, http://austinboxerrescue.com/events/list/ shows events in proper chronological order for me.)

    #992935
    Richard Schalin
    Participant

    Hello George,

    I’m talking about the feed on my clients Home page http://screencast.com/t/nnOU3BVuUul

    Chronological just means in Newest to Oldest date order. Really I guess what I need help with is what would be the best way to display this feed on a page? Right now my developer is using some php and it’s messing with the footer on the site.

    #993218
    George
    Participant

    Hey Michele,

    Thanks for the update – so you mean that the feed there is custom coded by your developer? If so, unfortunately we’ll have to leave the developer with the reins here, as we do not support custom code.

    BUT, the code being used there might be too complicated or something, because if your goal is just to display upcoming events, then you (and/or your developer) may find it much more straightforward to just create a widget area instead of trying to custom-code a solution.

    To add a widget there, you could use WordPress functions like the_widget() to manually call an instance of the Tribe Events List Widget, and then just use CSS to customize the appearance to your site’s needs.

    If that’s not an appropriate solution, then while we do not offer any support for custom code…you should contact your developer to post their custom code in a Gist at http://gist.github.com. Share the link to the Gist, and I can take a quick look to see if something obvious is causing the date discrepancy.

    Cheers,
    George

    #993231
    Richard Schalin
    Participant

    Ok we have stripped any and all custom coding out and are now using [tribe_events_list city=”yes” organizer=”yes” limit=”4″] to try and display upcoming events. Now we have a big hole… any suggestions?

    #993235
    Richard Schalin
    Participant

    Sorry, client didn’t want a big hole on the site so I had to put it back.

    This is the code we’re currently using to display the events feed on the home page

    <?php  $args1 = array(
       'post_status'=>'publish',
      'post_type'=> 'tribe_events',
      'posts_per_page'=>5,
      //order by startdate from newest to oldest
      'meta_key'=>'_EventStartDate',
      'orderby'=>'_EventStartDate',
      'order'=>'DESC',
      //required in 3.x
      'eventDisplay'=>'past'
    );
     $last_five_posts1 = get_posts( $args1 );   ?>
     
    
     <div  class="cmsms_heading_wrap cmsms_heading_align_left">
      <h3 class="cmsms_heading">Upcoming Events</h3>
     </div>
     <br/>
    
     <?php foreach ( $last_five_posts1 as $post ) : setup_postdata( $post ); ?>   
    
     <article style="width:100%;" id="post-200" class="cmsms_default_type post-200 post type-post status-publish format-standard has-post-thumbnail hentry category-boxer-in-need">
      <div class="cmsms_column">
       <div class="cmsms_post_info entry-meta">
        
        
       </div>
       <div class="cmsms_post_cont" style="text-align:left!important;">
        <header class="cmsms_post_header entry-header">
         
         <h3 class="cmsms_post_title entry-title" style="text-align:left;">
         <a style="text-align:left;" href="<?php echo get_permalink(); ?>"><?php echo get_the_title( $ID ); ?> </a>
         </h3>
        </header>
        
       
        <div class="cmsms_post_content entry-content" style="text-align:left!important;">
         <?php the_excerpt($id); ?>   
        </div>
        <footer class="cmsms_post_footer entry-meta" style="text-align:left!important;">
        
         <a style="text-align:left;" class="cmsms_read_more cmsms_post_read_more" href="<?php echo get_permalink(); ?>">
         Read More
         <span class="cmsms_wrap_arrow">
          <span class="cmsms_next_arrow">
           <span></span>
          </span>
         </span>
         </a>
        </footer>
       </div>
      </div>
     </article>
     
     <?php endforeach;  wp_reset_postdata(); ?>
    #993673
    George
    Participant

    Hey Michelle,

    Your custom code might work fine, but instead of calling get_posts() directly, why not use tribe_get_events()? It’s an alias for get_posts() anyways, but adds some additional features specifically geared toward filtering by date.

    Check out this Knowledgebase article for examples → https://theeventscalendar.com/knowledgebase/using-tribe_get_events/

    You should be able to leave pretty much all that code alone and just swap out get_posts() and some of your arguments for it with tribe_get_events() and some arguments specific to it as shown in that article.

    Let us know if this helps!

    — George

    #997584
    Support Droid
    Keymaster

    This topic has not been active for quite some time and will now be closed.

    If you still need assistance please simply open a new topic (linking to this one if necessary)
    and one of the team will be only too happy to help.

Viewing 9 posts - 1 through 9 (of 9 total)
  • The topic ‘Upcoming Events feed on home page showing incorrectly’ is closed to new replies.