Limit number of events listed in Venue view

Home Forums Calendar Products Events Calendar PRO Limit number of events listed in Venue view

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1152568
    Emily Holton
    Participant

    Hi! On my venue pages, events are listed at the bottom. Is there a way to limit the # of events displayed, and add a “See all events” link at the bottom or something like that? Listing them all at once makes for a very long page!! Thank you ๐Ÿ™‚ http://wheretogokiddo.com/venue/scadding-court-community-centre/

    #1152876
    Nico
    Member

    Hi there @wheretogokiddo,

    Thanks for getting in touch with us! I can help you here…

    Default limit for events in venue pages is 100, although you can modify this with the following code:

    /* Tribe, limit events in single venue pages */
    add_filter( 'tribe_events_single_venue_posts_per_page', function (){ return 10; } );

    Place the code above in your theme’s (or child theme’s) functions.php file and it will change the limit. Please note that this won’t generate pagination, it will just limit the max of events shown.

    If you intention is to have a ‘show all option’ it can be added via JS (hide/show event divs) or by creating a link to the same page with a query string to ignore the new limit.

    Please let me know if this helps,
    Best,
    Nico

    #1154212
    Emily Holton
    Participant

    Worked perfectly, thank you!

    #1154319
    Nico
    Member

    Stocked to hear @wheretogokiddo ๐Ÿ™‚

    Iโ€™ll go ahead and close out this thread, but if you need help with anything else please donโ€™t hesitate to create a new one and we will be happy to assist you.

    Hope you have a great week,
    Nico

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Limit number of events listed in Venue view’ is closed to new replies.