Event Organiser
[resolved] Limit # of events displayed (5 posts)

  1. Damon Cook
    Posted 4 years ago #

    Is it currently possible to limit the # of events displayed? I would like to use the [eo_events att1="val1" att2="val2"], but perhaps show only the next 5 (or less) upcoming events this month for a certain category. I know I can limit to category and limit to this month:
    [eo_events event_category="upcoming-events" event_start_before="+1 month"]
    , but I want to limit to only 5 events displayed or less. Thoughts?


  2. Stephen Harris
    Posted 4 years ago #

    You can use the numberposts attribute,
    [eo_events event_category="upcoming-events" numberposts=5 event_start_before="+1 month"].

    The short-code simply uses eo_get_events, itself not much more than a wrapper for WordPress' get_posts, which means generally speaking, arguments used for get_posts can be used for the shortcode/ eo_get_events.

    Obviously, shortcodes cannot except arrays as arguments, while eo_get_events can (and so you can use WordPress' tax_query with eo_get_events).

  3. Damon Cook
    Posted 4 years ago #

    Thanks Stephen! Your plugin is getting 5 stars from me now. Have a great day!

  4. earthtojeremy
    Posted 4 years ago #

    How would I apply this concept in the php in the archive-event.php template? I want my events page to list a different number of posts than the universal WP pagination control in the Settings area.

  5. Stephen Harris
    Posted 4 years ago #

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Event Organiser
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic