Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * Paste in your theme functions.php
- */
- function em_mod_custom_events_list(){
- $events = EM_Events::get(array('scope'=>'future','limit'=>10));
- ?>
- <table>
- <tbody>
- <?php
- $start = false;
- $limit = 3;
- $count = 1;
- foreach( $events as $EM_Event ){
- if ( !empty($EM_Event->event_name) ){
- ?>
- <?php if ( !$start ) { ?>
- <tr>
- <?php $start = true; ?>
- <?php } ?>
- <td><?php echo $EM_Event->output("#_EVENTLINK"); ?></td>
- <?php
- if ( $count == $limit ){
- ?>
- </tr>
- <?php
- $start = false;
- $count = 1;
- }else{
- $count++;
- }
- ?>
- <?php
- }
- }
- ?>
- </tbody>
- </table>
- <?php
- }
- add_shortcode('custom_events_list', 'em_mod_custom_events_list');
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement