Forums › Forums › Search & Filter Pro › Eventica theme – make search find most recent events
- This topic has 4 replies, 2 voices, and was last updated 7 years, 8 months ago by
Trevor.
-
Anonymous(Private) July 10, 2017 at 12:33 pm #119668
Hi Trevor,
I am using the plugin on my website to display events: https://www.mcrgreater.co.uk/events/. Currently, when users see the page, they see old events on page 1. Is there a way for me to display the most recent events on the main events page when users first load it? Ideally, I would like users to see the content on the 3rd page as it lists the events for this month. So next month, the main events displayed will be augaust and so on.
Thanks,
IhtezazTrevor(Private) July 10, 2017 at 12:46 pm #119671Hi
It is possible to enclose the search results code loop an an if statement to check IF the page has any filters applied, and delivery different content if no filters have been used. Would that help?
This post will give you the idea:
https://support.searchandfilter.com/forums/topic/results-appear-only-on-submit/#post-116180
Anonymous(Private) July 12, 2017 at 3:19 pm #120197Hi Trevor,
I implemented the if statement but it’s not what I am quite looking for. I want the results to show so that any recent event (e.g within a 30 day period) is displayed first, followed by any ongong events. I have contacted the theme developer as it may be a question for them but if you think you have a solution, please let me know.
I have also got another issue with the results page:
The previous results displayed a gray bar on top of all events within a month e.g : if you go onto the site and search ‘itv’ next to the date filter on the events page, you will see the grey bar:
https://www.mcrgreater.co.uk/events/
I have found the code to add the bar:
<?php tribe_events_list_the_date_headers(); ?>
but I am not too sure where it would go in the results.php file.
I can show you the issue on skype – if needed.
Thanks,
IhtezazAnonymous(Private) July 12, 2017 at 3:32 pm #120200Please see below for my current results.php code:
‘
if ( $query->have_posts() ) { ?>
<div class=”tribe-events-list” id=”tribe-events-content”>
<div class=”events-loop tribe-events-loop vcalendar”>
<div class=”row”>
<div class=”tribe-events-page-title-wrap” style=”position: relative; text-align: center;”>
<h2 class=”tribe-events-page-title”><?php echo tribe_get_events_title() ?></h2>
</div><?php while ($query->have_posts()) { $query->the_post(); ?><?php if ( ! defined( ‘ABSPATH’ ) ) { die( ‘-1’ ); } // Setup an array of venue details for use
later in the template $venue_details = tribe_get_venue_details(); if ( isset( $venue_details[
‘linked_name’] ) ) { $venue_name=$venue_details[‘linked_name’]; } elseif ( isset( $venue_details[
‘name’] ) ) { $venue_name=$ venue_details[ ‘name’]; } else { $venue_name=” ; } // Venue
$has_venue_address=( ! empty( $venue_details[ ‘address’] ) ) ? ‘ location’ : ”;
<div class=”type-tribe_events post-3031 tribe-clearfix tribe-events-category-casual tribe-
events-category-development tribe-events-category-education tribe-events-category-engineering
tribe-events-category-exhibition
tribe-events-category-exploring tribe-events-category-gallery tribe-events-category-history
tribe-events-category-learning tribe-events-category-museum tribe-events-category-other tribe-
events-category-science tribe- events-category-textiles tribe-events-venue-2987 tribe-events-
organizer-3034 tribe-events-first col-sm-6″>” title=”<?php the_title(); ?>”>
<div class=”even-list-wrapper”>
<div class=”event-list-wrapper-top”>
<div class=”tribe-events-event-image”>
<?php if(has_post_thumbnail()) : ?><?php the_post_thumbnail( ‘blog-thumbnail’ ); ?><?php else : ?>” src=”%3C?php%20echo%20get_template_directory_uri();%20?%3E/img/thumb-event.png”> <?php endif; ?>
</div>
<div class=”tribe-events-event-date”>
<span class=”dd”><?php echo tribe_get_start_date( null, false, ‘d’ ) ?></span> <span class=”mm”><?php echo tribe_get_start_date( null, false, ‘F’ ) ?></span> <span class=”yy”><?php echo tribe_get_start_date( null, false, ‘Y’ ) ?></span>
</div>
</div>
<div class=”event-list-wrapper-bottom”>
<div class=”wraper-bottom-left”>
<!– Event Title –>
<?php do_action( ‘tribe_events_before_the_event_title’ ) ?>
<h2 class=”tribe-events-list-event-title entry-title summary”>“><?php the_title() ?></h2><?php do_action( ‘tribe_events_after_the_event_title’ ) ?><!– Event Meta –>
<?php do_action( ‘tribe_events_before_the_meta’ ) ?>
<div class=”tribe-events-event-meta vcard”>
<div class=”author <?php echo esc_attr( $has_venue_address ); ?>”>
<?php if ( $venue_name ) : ?>
<div class=”tribe-events-venue-details”>
<?php echo wp_kses_data( $venue_name ); ?>
</div><?php endif; ?>
<div class=”time-details”>
<?php tokopress_tribe_event_time(); ?><?php echo tokopress_tribe_event_recurringinfo( ‘<br/><i class=”fa fa-refresh”></i> ‘); ?>
</div>
</div>
</div><!– .tribe-events-event-meta –>
<?php do_action( ‘tribe_events_after_the_meta’ ) ?>
</div>
<div class=”wraper-bottom-right valign-wrapper”>
<i class=”fa fa-ticket”></i> <?php if ( $cost=tribe_get_cost( null, true ) ) printf( ‘<br/><span class=”cost”>%s</span>’, $cost ); ?>
</div>
</div>
</div>
</div><?php } ?>
</div>
</div><?php do_action( ‘tribe_events_before_footer’ ); ?>
<div id=”tribe-events-footer”>
<!– Footer Navigation –>
<div class=”pagination”>
<?php
/* example code for using the wp_pagenavi plugin */
if (function_exists(‘wp_pagenavi’))
{
wp_pagenavi( array( ‘query’ => $query ) );
}
?>
</div>
</div>
‘Thanks,
IhtezazTrevor(Private) July 12, 2017 at 3:37 pm #120205So, when there is no filter, you want those first events, and then the normal events. But do you expect those first ’30 day period’ events to be excluded from the following list of ongoing events? That would get very tricky.
As for the date, it needs to appear inside the div with the
event-list-wrapper-top
class, after the div with thetribe-events-event-image
class. -
AuthorPosts