Show past events if upcoming there are no upcoming events on homepage

Home Forums Welcome! Pre-Sales Questions Show past events if upcoming there are no upcoming events on homepage

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1098218
    Faith
    Guest

    Good Day,

    I’m doing a project on my site. and i’d like to post the past events if there are no upcoming events on my site.

    here’s my code just posting only upcoming events:

    <div class=”events”>

    <!–Here comes the loop with tribe_events post type–>
    <?php $loop = new WP_Query( array( ‘post_type’ => ‘tribe_events’, ‘posts_per_page’ => ‘4’, ‘orderby’ => ‘date’, ‘order’ => ‘ASC’, ) ); ?>

    <?php while ( $loop->have_posts() ) : $loop->the_post(); ?>

    <div class=”event-wrap”>

    • <!– Event Title –>
      <?php do_action( ‘tribe_events_before_the_event_title’ ) ?>

      ” title=”<?php the_title_attribute() ?>” rel=”bookmark”>
      <?php the_title() ?>

      <?php do_action( ‘tribe_events_after_the_event_title’ ) ?>

      <div class=”date”><?php echo tribe_get_start_date( null, false, ‘M j, Y’ ); ?> – <?php echo tribe_get_end_date( null, false, ‘M j, Y’ ); ?> </div>
      <!– Event Image –>
      <?php echo tribe_event_featured_image( null, ‘medium’ ) ?>

      <!– Event Content –>
      <?php do_action( ‘tribe_events_before_the_content’ ) ?>
      <div class=”tribe-events-list-event-description tribe-events-content”>
      <?php echo tribe_events_get_the_excerpt( null, wp_kses_allowed_html( ‘post’ ) ); ?>
      </div><!– .tribe-events-list-event-description –>
      <?php
      do_action( ‘tribe_events_after_the_content’ );
      ?>

    </div><!– event-wrap –>
    <?php endwhile; ?>
    <div class=”clear”></div>
    </div><!– events –>

    can anyone help me.

    Thanks in advance.

    #1098846
    Brook
    Participant

    Howdy Faith,

    That’s a great idea for a modification. You have a few options for moving forward with this:

    1. Do you have a license to one of our plugins? If you login I can move this topic from the presales area here to our Premium Support Forum and we can take it from there.
    2. Or, if you don’t have/want a license (which includes a year of support) you should checkout the volunteer community on WordPress.org: The Events Calendar. It’s not the same level of support, but it’s free! We even check those forums once each week and help to the extent we can.
    3. Suggest this idea as an official feature request. I could see some other folks being interested in it too and thus something we would be interested in building. The only caveat is that this will take a couple of months minimum before something becomes popular enough that we can slot it in amongst all the other ideas.

    Does that all make sense?

    Cheers!

    – Brook

    #1099507
    Ghilaine
    Guest

    Hi,
    I’m interested in the same function.
    I’d like to see the past events, without having to click on “past events”.
    Is it possible ?
    Thanks for your help !
    Best regards
    Ghilaine

    #1099663
    Brook
    Participant

    Howdy Ghilaine,

    Thanks for taking the time to post. If this is something you’d like to see please suggest it as a feature for our calendar. I don’t think Faith has yet. But if you do post it you both should vote on it and give this idea a jump start!

    • Brook
    #1100199
    anna
    Participant

    I need this feature as well. I saw some past event feature ideas but I wasn’t sure which one I should vote for.

    #1101182
    Brook
    Participant

    That’s good to know Anna. I appreciate the feedback. You should definitely vote on the official feature request as well: https://tribe.uservoice.com/forums/195723-feature-ideas/suggestions/13392369-list-view-show-past-events-if-none-are-upcoming

    Cheers!

    – Brook

    #1107216
    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 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Show past events if upcoming there are no upcoming events on homepage’ is closed to new replies.