Add limit="x" option to tribe_events shortcode
Adding a LIMIT argument to the tribe_events shortcode could work for Photo, List, Day, and Map views.
The shortcode option in Pro is great!
It would be even greater if there was an option to limit the shown events in the list.
Like: [tribe_events limit="10" view="photo"]
Than you would be able to show the Photo view for instance on the homepage only the first 3 events and on a calendar page all the events.
Thank you for the idea! We definitely see the value in this. It has been added to our list of features we would like to implement. We thank you for your patience as we work through all of the other features that were added before this one.
Eric from our forums shared an excellent snippet of code that allows you to alter this right now. As he notes it employs a bit of a hack, but it should work on most servers. You can paste this code in your functions.php, modify the number of events you want shown inside the code, and you’re done!
If you have any questions or need assistance, please don’t hesitate to reach out via our forums. Cheers!
- The Modern Tribe Support Team
The proposed workaround does not really work as clicking on the "Previous/Next events" links shows whatever the default is in the plugin settings and not what is hard coded in the functions.php
I am supporting this feature request. It would really help me.
Andres Fernandez commented
This would be a great feature, and it's rather easy to accomplish (I already did on the website where I need the feature). It's a matter of adding a "limit" attribute to the setup function that is then passed as the "posts_per_page" value to the function that prepares the query, and adding a "no_found_rows=true" to that same function to avoid pagination issues (all of this on /events-calendar-pro/src/Tribe/Shortcodes/Tribe_Events.php). I'm not encouraging anyone to "hack" the plug-in, but that's just how I did it to solve for my needs.