Posted: July 10, 2014 at 6:44 am
|
hi but each page has a diffrent number of events on it haow can i display the same amout per page |
Hi, You can use the pagination option here: https://eventespresso.com/wiki/shortcodes-template-variables/#event-list [EVENT_LIST category_identifier=your_category_identifier events_per_page=10] — |
|
|
Hi, there seems to be a problem with the paging mechanism in that the paging applies to the SQL resultset (500+ events are returned in the result set) ..but further down in where the events are rendered there is additional logic causing inactive events to be hidden, breaking the paging logic? Thanks. |
|
Just to clarify: the code I was looking at was in the file /plugins/event-espresso/templates/event_list.php …around line 406. Is this an issue that you guys will be looking at fixing? Is this something that is resolved in version 4? |
Hi Blue, We have a fix for this due for release with the next version of Event Espresso. However If you would like to apply this fix to your current version of EE you can edit the file event-espresso/templates/event_list.php Theres 2 edits to make, firstly on line 65 you’ll find: 'use_wrapper' => true Add a comma to the end of that line and then under that add: 'exclude_closed_events' => 'false' So like this – http://take.ms/rP6i2 Then on (now) line 149 you’ll find: $sql .= $show_expired == 'false' ? " AND (e.start_date >= '" . date('Y-m-d') . "' OR e.event_status = 'O' OR e.registration_end >= '" . date('Y-m-d') . "') " : ''; Change that to be if($exclude_closed_events == 'false'){ $sql .= $show_expired == 'false' ? " AND (e.start_date >= '" . date('Y-m-d') . "' OR e.event_status = 'O' OR e.registration_end >= '" . date('Y-m-d') . "') " : ''; } else { $sql .= $show_expired == 'false' ? " AND (e.event_status = 'O' OR e.registration_end >= '" . date('Y-m-d') . "') " : ''; } Like so – http://take.ms/cTf3c You now have a new attribute ‘exclude_closed_events’, set that to true within your shortcode to remove close/expired events from results. exclude_closed_events=true [EVENT_LIST category_identifier=your_category_identifier events_per_page=10 exclude_closed_events=true] |
|
Also to note EE4 is a vastly different system in that it uses custom post types for the events meaning the pagination is the done in the same way as standard posts. |
|
|
This doesn’t seem to fix our problem.
…non-expired event = registration end date AND the event start date or both in the future (or the event is ongoing). I’m yet to try this out so I may be way off the mark. |
Hi Blue, It kind of depends on how you want to define expired, so you’re welcome to tweak the template to fit your needs. |
|
The support post ‘Events per page’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.