Home › Forums › Welcome! › Pre-Sales Questions › Show past events if upcoming there are no upcoming events on homepage
- This topic has 6 replies, 3 voices, and was last updated 10 years ago by
Support Droid.
-
AuthorPosts
-
April 5, 2016 at 12:56 am #1098218
Faith
GuestGood 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.
April 6, 2016 at 4:43 am #1098846Brook
ParticipantHowdy Faith,
That’s a great idea for a modification. You have a few options for moving forward with this:
- 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.
- 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.
- 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
April 7, 2016 at 6:25 am #1099507Ghilaine
GuestHi,
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
GhilaineApril 7, 2016 at 10:09 am #1099663Brook
ParticipantHowdy 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
April 8, 2016 at 12:07 pm #1100199anna
ParticipantI need this feature as well. I saw some past event feature ideas but I wasn’t sure which one I should vote for.
April 11, 2016 at 11:02 pm #1101182Brook
ParticipantThat’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
April 26, 2016 at 9:35 am #1107216Support Droid
KeymasterThis 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. -
<!– Event Title –>
-
AuthorPosts
- The topic ‘Show past events if upcoming there are no upcoming events on homepage’ is closed to new replies.
