Forum Replies Created
-
AuthorPosts
-
MogulParticipant
Still cannot get the above working, I had a thought of doing it with categories, but when i do the url /auctions/category/2017/
I don’t get any auctions as they have past, is there anyway to add past auctions to show on categories?
MogulParticipantThanks,
/auctions/photo/?tribe_event_display=past&tribe-bar-date=2016 still shows all past events including yesterdays.
/auctions/photo/?tribe_event_display=past&tribe-bar-date=2016 shows exactly the same as the 2016 url, where it should only show yesterdays event
MogulParticipantThanks, how would you see the url for that piece of code?
At the moment i am using: /auctions/photo/?tribe_event_display=past&tribe-bar-date=2016-01-01 which shows the only event in 2015, which was the first event on the site,
Then /auctions/photo/?tribe_event_display=past&tribe-bar-date=2017-01-01 shows the events in 2016 and also the only event in 2015 which i don’t want to appear.
thanks
- This reply was modified 7 years, 3 months ago by Mogul.
MogulParticipantthat seems to sort of work, is there a way to make it specific for past events, so it doesn’t pick up upcoming events?
thanks
MogulParticipantReally, i just want to use a link like /auctions/photo/?tribe_event_display=past&tribe-bar-date=2016 and it just shows all events in 2016 or /auctions/photo/?tribe_event_display=past&tribe-bar-date=2015 and it shows all events in 2015.
At the moment /auctions/photo/?tribe_event_display=past&tribe-bar-date=2015, shows 2015 and then 2016.
the code i am using atm is:
add_action( 'tribe_events_pre_get_posts', function( $query ) { $ajax_or_main = ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || $query->is_main_query(); if ( ! $ajax_or_main || empty( $_REQUEST['tribe-bar-date'] ) ) { return; } if ( ! preg_match( '/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $_REQUEST['tribe-bar-date'], $matches ) ) { return; } $end_date = date('Y-m-d', strtotime( $matches[0] . ' +1 year') ); $query->set( 'end_date', $end_date); } );
How can i amend that to do what i need?
thanks
- This reply was modified 7 years, 3 months ago by Mogul.
MogulParticipantI found this snippet on this thread: https://theeventscalendar.com/support/forums/topic/event-search-bar-date-function/
/* Tribe, limit tribe bar date search to one day */ add_action( 'tribe_events_pre_get_posts', function( $query ) { $ajax_or_main = ( defined( 'DOING_AJAX' ) && DOING_AJAX ) || $query->is_main_query(); if ( ! $ajax_or_main || empty( $_REQUEST['tribe-bar-date'] ) ) { return; } if ( ! preg_match( '/^[0-9]{4}-[0-9]{2}-[0-9]{2}$/', $_REQUEST['tribe-bar-date'], $matches ) ) { return; } $end_date = date('Y-m-d', strtotime( $matches[0] . ' +1 day') ); $query->set( 'end_date', $end_date); } );
Is there a way to edit this so it shows just 1 year?
MogulParticipantI have found this from the documentation:
// Retrieve all events in 2016
$events = tribe_get_events( array(
‘eventDisplay’ => ‘custom’,
‘start_date’ => ‘2016-01-01 00:01’,
‘end_date’ => ‘2016-12-31 23:59’
) );How do i show this in the front end? Do i need to setup a new page template, or is there a better way?
thanks
MogulParticipantAnyone?
MogulParticipantthats great thanks
MogulParticipantthats great thanks
MogulParticipantEvery instance would be great,
thanks
August 10, 2016 at 7:25 am in reply to: Pro version, photo view, filter bar button not working #1149932MogulParticipanti do but i have made another thread for it, thanks
August 10, 2016 at 5:41 am in reply to: Pro version, photo view, filter bar button not working #1149906MogulParticipantthanks
MogulParticipantThis reply is private.
MogulParticipantThis reply is private.
-
AuthorPosts