Home › Forums › Calendar Products › Events Calendar PRO › [tribe_events] Shortcode Limit option not Working
- This topic has 9 replies, 7 voices, and was last updated 7 years, 2 months ago by devdept.
-
AuthorPosts
-
December 15, 2016 at 8:45 am #1206512devdeptParticipant
Hello!
I’m trying to show only one event in my “featured-events” category, but it keeps showing 2 events. I have the shortcode set as:
[tribe_events view=”list” category=”featured-events” limit=”1″]
but that doesn’t seem to be working properly. Please help? The only way I’ve gotten it to work is by setting whatever second event to display:none; and I’d rather not have to constantly go in and set my new featured event every time an old one passes. Thank you.
December 15, 2016 at 11:55 am #1206611GeoffMemberHi Nick, thanks for reaching out!
I think the issue is that there actually is no “limit” filter available for the shortcode.
Looking at our documentaiton for shortcodes, the only filter available for limiting the number of events that might display is to set a date range, like:
[tribe_events view="list" category="featured-events" date="2016-08-21"]
Does this help answer your question? Please let me know.
Cheers!
GeoffDecember 23, 2016 at 8:46 am #1210073Andres FernandezParticipantHello Tribe,
Trying to accomplish the exact same thing as Nick… it would be tremendously helpful if you guys would consider adding the “limit” parameter to the “calendar view” [tribe_events] shortcode, to override the limit set in the plug-in’s main settings.
The reason this would be helpful is that for Events Calendar Pro users (like Nick and myself), having the ability to display a “rich” view on any given page (other than the main events page) while being able to control the number of events displayed, would be more interesting than being restricted to rendering the list widget via shortcode (the list view widget is great for a sidebar, but not nearly as great to display events in a section of a full-width page).
I highly encourage you to consider this improvement to an upcoming update of the plug-in, it’ll make it that much more powerful.
Thanks!
December 28, 2016 at 7:26 am #1210990GeoffMemberHowdy @aplussideas.
Thanks for the feedback! It would be awesome if you would add your support behind the feature request for this so we can see more demand for it:
Thanks a ton!
GeoffJanuary 12, 2017 at 4:43 am #1217300EricParticipantAdded a vote to the uservoice topic!
Just a quick note how you can achieve this in a kind of hacky way. Add the following code to your functions.php to change the number of posts in a shortcode:
function sif_tribe_option($option, $optionName, $default) { //change number of posts per page $numberOfPostsInShortcode = 3; if($optionName == 'postsPerPage') { //are we in a shortcode? $in_shortcode = in_array( 'do_shortcode', wp_list_pluck( debug_backtrace(), 'function' ) ); if($in_shortcode) { return $numberOfPostsInShortcode; } else { return $option; } } //always return an option return $option; } add_filter('tribe_get_option', 'sif_tribe_option', 10, 3);
January 12, 2017 at 6:40 am #1217346GeoffMemberThat is really awesome, @Eric! Thanks so much for the tip — I know others will find that super helpful and I couldn’t appreciate it more. 🙂
Cheers,
GeoffJanuary 26, 2017 at 4:06 am #1224267akalwpParticipantHi @Geoff
I’m facing the same issue. I don’t understand when you said “I think the issue is that there actually is no “limit” filter available for the shortcode.”
I found this fonction in the knowledge base of your site for those who paid for the Pro version:
“Events Calendar PRO Widget Shortcodes Overview”= https://theeventscalendar.com/knowledgebase/pro-widget-shortcodes/Event List Shortcode Part:
“Finally, you can specify the maximum number of events that should be listed: [tribe_events_list limit=”10″]”The tribe events limit fonction worked great before last update.
Regards
AkalJanuary 26, 2017 at 7:20 am #1224340GeoffMemberHello @akalwp,
You’re absolutely right, but the topic of this thread is actually about the use of a “limit” variable in the full view shortcodes:
https://theeventscalendar.com/knowledgebase/embedding-calendar-views-tribe_events-shortcode/
The “limit” you are referring to is specifically for the calendar widgets. I searched the forums and was unable to find another other reports of “limit” not working, but please do open a new thread and we’d be happy to troubleshoot it with you and open a ticket to fix it if we can confirm the issue.
Thanks so much!
GeoffFebruary 17, 2017 at 8:35 am #1239949Support DroidKeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support Team -
AuthorPosts
- The topic ‘[tribe_events] Shortcode Limit option not Working’ is closed to new replies.