Increase the number of events displayed in the list widget?

Home Forums Calendar Products Events Calendar PRO Increase the number of events displayed in the list widget?

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #996845
    Aindreas
    Participant

    Hello (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,
    Aindreas

    #996901
    George
    Participant

    Hey 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!
    George

    #997143
    Aindreas
    Participant

    Perfect!
    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,
    Aindreas

    #997221
    Elisabeth
    Participant

    Hi,

    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,
    Elisa

    #997349
    George
    Participant

    Hey 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

    #997361
    Elisabeth
    Participant

    Hi 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

    #997658
    George
    Participant

    Hey 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,
    George

    #997659
    George
    Participant

    I’ve addressed Aindreas’ original questions so I will close up this thread for now – cheers!

    George

Viewing 8 posts - 1 through 8 (of 8 total)
  • The topic ‘Increase the number of events displayed in the list widget?’ is closed to new replies.