Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- Display random events list using custom shortcode [similarevents]
- */
- function similar_events() {
- $replace = "";
- $temp = array();
- $events = EM_Events::get(array('scope'=>'future'));
- foreach ( $events as $EM_Event ) {
- array_push($temp,'<h6>'.$EM_Event->output('#_EVENTLINK').'</h6>');
- }
- shuffle($temp);
- foreach ( $temp as $event ) {
- if ($limit < 4)$replace .= $event;
- $limit++;
- }
- return $replace;
- }
- add_shortcode( 'similarevents', 'similar_events' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement