Home › Forums › Calendar Products › Events Calendar PRO › Increase the number of events displayed in the list widget?
- This topic has 7 replies, 3 voices, and was last updated 10 years, 8 months ago by
George.
-
AuthorPosts
-
August 18, 2015 at 12:23 am #996845
Aindreas
ParticipantHello (again),
I was wondering if it was possible to increase the amount of events displayed in the Events List widget.I would like to display a great deal more. Im guessing its a number that has to be changed on one of the php files. If you could point me in the right direction Im sure I could figure something out!
Thanks in advance!
(and thanks again for all the other support you have offered so far!)Kind Regards,
AindreasAugust 18, 2015 at 6:31 am #996901George
ParticipantHey Aindreas!
Thanks for the kind words π
As for your question specifically, you should be able to modify that number right in the widget admin, as shown in this screenshot β https://cloudup.com/cwv8HoE2723
Do you find that to work for you? Or are you trying to add even more than 10 events there?
If you want to add more than 10 events, you can currently only do that by adding a bit of code to your theme’s functions.php file, like this:
add_filter( 'tribe_events_list_widget_query_args', 'tribe_add_many_events_to_list_widget' );function tribe_add_many_events_to_list_widget( $args ) {
if ( ! isset( $args['posts_per_page'] ) ) {
return $args;
}$args['posts_per_page'] = 20;
return $args;
}
Just modify that bit that reads $args[‘posts_per_page’] = 20; to be whatever number you’d like, and you should be good to go π
Cheers!
GeorgeAugust 19, 2015 at 12:59 am #997143Aindreas
ParticipantPerfect!
Yes I wanted to increase the amount of posts per page to beyond the default max of 10.This helped a lot, thank you!
Just one more question, is it possible to increase the numbers you can select so that individual widgets can have different values? eg: 1 widget on homepage has 25 results, while on the sidebar you have 10 results (as in increase the number on the dropdown list).
Not too many worries if it does not work, thanks for all your help, much appreciated!
Kind Regards,
AindreasAugust 19, 2015 at 7:58 am #997221Elisabeth
ParticipantHi,
this would be interesting for me too.
I add the code in functions.php, but then
[tribe_events_list limit=”10″] do not work any longer, right?Best,
ElisaAugust 19, 2015 at 1:37 pm #997349George
ParticipantHey folks,
Glad to have helped here originally. Unfortunately, however: no, it is not possible at this time to write per-widget code like you mentioned very easily π You could probably manage it in theory, but the code to do so is too complex for the support forums here and would depend on your use case for things.
Sorry for the disappointment there!
As for your question Elisa, no, the filter I shared above will not affect the shortcode.
Best of luck with your sites folks π
β George
August 19, 2015 at 2:03 pm #997361Elisabeth
ParticipantHi George,
sorry, then I dont get it. Which is the strongest one?
My tests:
Modification funcions.php (overwrites all?)
Embedded: [tribe_events_list limit=β20β³]
Events -> Settings -> General -> Number of list [20]
Widget -> up to 10 πWhats wrong?
Elisa
August 20, 2015 at 9:44 am #997658George
ParticipantHey Elisa,
For the specific question of this thread, which is increasing the amount of events in the widget, the only options are these ones you listed:
Widget -> up to 10 π
Modification funcions.php (overwrites all?)
At this time, the other options you listed will not address this and will not change the amount of events that show in the list widget.
I’m sorry to disappoint!
Cheers,
GeorgeAugust 20, 2015 at 9:45 am #997659George
ParticipantI’ve addressed Aindreas’ original questions so I will close up this thread for now βΒ cheers!
George
-
AuthorPosts
- The topic ‘Increase the number of events displayed in the list widget?’ is closed to new replies.
