Paula

Forum Replies Created

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • in reply to: Add custom filter-view.min.css #1114070
    Paula
    Participant

    Hi Nico,

    Thank you for your assistance. It worked 🙂

    I’d like to point out the following. I have added a custom template to overwrite template from ‘filterbars’ plugin. In order for that to work, I have to put the template in the following folder “/my-theme/tribe-event/filter-bar/filter-view-horizontal.php, please note, it needs to be name ‘filter-bar’ as its original folder is ‘/the-events-calendar-filterbar/src/views/filter-bar/filter-view-horizontal.php’, and that is why it confused me to think that the css need to be added into ‘/filter-bar/’ too.

    I think it would be very beneficial to state this difference in the ‘themer-guide’, and provide more custom css examples, maybe one for each plugin 🙂

    Once again, thank you very much for your help.

    Kind regards
    Ben

    in reply to: Custom display (next 7 days) #1104071
    Paula
    Participant

    Hi Nico,
    My customisation code will cause a 404 on the event detail page. I am currently working to find a solution. Will report back here later.

    Regards
    Ben

    in reply to: Custom display (next 7 days) #1101797
    Paula
    Participant

    Hi Nico,

    Thank you for your help, really appreciated!
    I am end up using add_action instead, does what I need so far, will do more testing on this.

    Here is the code.

    
    function custom_list_view_query($query){
    
        if ( $query->tribe_is_event || $query->tribe_is_event_category ) {
            if ( ! empty( $query->query_vars['eventDisplay'] ) ) {
                switch ( $query->query_vars['eventDisplay'] ) {
                    case 'all':
                    case 'list':
                    default: // default display query
                        $event_date = ( $query->get( 'eventDate' ) != '' )
                            ? $query->get( 'eventDate' )
                            : date_i18n( Tribe__Date_Utils::DBDATETIMEFORMAT );
                        if ( ! $query->tribe_is_past ) {
                            $query->set( 'start_date', ( '' != $query->get( 'eventDate' ) ? tribe_beginning_of_day( $event_date ) : tribe_format_date( current_time( 'timestamp' ), true, 'Y-m-d H:i:s' ) ) );
                            /*
                             * customisation
                             */
                            $end_date = date( Tribe__Date_Utils::DBDATEFORMAT, strtotime( $event_date . ' +6 day' ) );
                            $myrange = Tribe__Events__Pro__Templates__Week::get_hour_range();
                            $end_date .= ' ' .  str_pad( end( array_keys( $myrange ) ), 2, '0', STR_PAD_LEFT ) . ':59:00';
                            $query->set( 'end_date', $end_date );
    
                            $query->set( 'order', Tribe__Events__Query::set_order( 'ASC', $query ) );
                        } else {
                            // on past view, set the passed date as the end date
                            $query->set( 'start_date', '' );
                            $query->set( 'end_date', tribe_end_of_day( $event_date ) );
                            $query->set( 'order', Tribe__Events__Query::set_order( 'DESC', $query ) );
                        }
                        $query->set( 'orderby', Tribe__Events__Query::set_orderby( null, $query ) );
                        $query->set( 'hide_upcoming', true );
                        break;
                }
            }
        }
        return $query;
    }
    
    add_action( 'tribe_events_pre_get_posts', 'custom_list_view_query' );
    

    Regards
    Ben

    in reply to: Custom display (next 7 days) #1095176
    Paula
    Participant

    Hi Nico,

    ” Altering the query for list view ” sounds good. Any advice on how to do this delicately would be great. Cheers

    Regards
    Ben

    in reply to: Custom display (next 7 days) #1093256
    Paula
    Participant

    Screenshot

Viewing 5 posts - 1 through 5 (of 5 total)