Event List Random

This topic contains 1 reply, has 2 voices, and was last updated by  Stephen Harris 11 years ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #5516

    Hi…

    I’m using the event list shortcode to display “related” events.

    I want to limit this to 3 events on the page, but would like the 3 events to load randomly from a greater amount. (i.e. there are 10 events, of which I want to display 3 random ones each time)

    Is that possible?

    thanks

    Andrew

    Andrew
    #5531

    HI Andrew,

    Not out of the box. But you could create your own shortcode to do this. You can use eo_get_events() (see docs) to query the next 10 events say, then pick three random integers between 0 and the number of events returned (as it may be less than 10) and use that to select the events, then display them however you like using the available functions.

    Stephen Harris
Viewing 2 posts - 1 through 2 (of 2 total)
To enable me to focus on Pro customers, only users who have a valid license for the Pro add-on may post new topics or replies in this forum. If you have a valid license, please log-in or register an account using the e-mail address you purchased the license with. If you don't you can purchase one here. Or there's always the WordPress repository forum.