Mogul

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 18 total)
  • Author
    Posts
  • in reply to: Only show past events from a certain year #1228791
    Mogul
    Participant

    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?

    in reply to: Only show past events from a certain year #1219495
    Mogul
    Participant

    Thanks,

    /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

    in reply to: Only show past events from a certain year #1217905
    Mogul
    Participant

    Thanks, 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.
    in reply to: Only show past events from a certain year #1217500
    Mogul
    Participant

    that 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

    in reply to: Only show past events from a certain year #1215015
    Mogul
    Participant

    Really, 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.
    in reply to: Only show past events from a certain year #1214225
    Mogul
    Participant

    I 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?

    in reply to: Only show past events from a certain year #1214219
    Mogul
    Participant

    I 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

    in reply to: Customizing the Tribe Events Bar #1193055
    Mogul
    Participant

    Anyone?

    in reply to: Change breadcrumb from Event to Auction #1151580
    Mogul
    Participant

    thats great thanks

    in reply to: Change the wording in wp backend menu #1151579
    Mogul
    Participant

    thats great thanks

    in reply to: Change the wording in wp backend menu #1150026
    Mogul
    Participant

    Every instance would be great,

    thanks

    in reply to: Pro version, photo view, filter bar button not working #1149932
    Mogul
    Participant

    i do but i have made another thread for it, thanks

    in reply to: Pro version, photo view, filter bar button not working #1149906
    Mogul
    Participant

    thanks

    in reply to: Switch Event Title and Event Duration in List View #1141807
    Mogul
    Participant

    This reply is private.

    in reply to: Switch Event Title and Event Duration in List View #1139254
    Mogul
    Participant

    This reply is private.

Viewing 15 posts - 1 through 15 (of 18 total)