Advertisement
Guest User

plugin:Events-Manager Daily Events php call

a guest
Mar 23rd, 2012
29
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.83 KB | None | 0 0
  1. if (class_exists('EM_Events')) {
  2.  
  3.     //  Get link to the main calendar of events
  4.     $event_page_link = trailingslashit(get_permalink(get_option("dbem_events_page")));
  5.  
  6.     //  Echo a page title called "DAILY EVENTS"
  7.     //  (we're sorting by days but could sort by weeks or months or years)
  8.     echo '<h2 class="entry-title" class="header"><a href="'.$event_page_link.'">Daily Events</a></h2>';
  9.  
  10.     //  START IGNORE - but if you need this code I'd be happy to provide it)
  11.     //  ADD "featured-image" from the page admin
  12.     $my_featured_image = my_postimage_picker($myimagetype='post-thumbnails', 0, $myimageclass='header-image');
  13.     echo $my_featured_image;
  14.     //  END IGNORE
  15.  
  16.     //  place any CMS copy / text below the heading and main photo
  17.     the_content();
  18.  
  19.  
  20.     //  This is the default php to echo the events
  21.     //  NOTICE it is commented out as we are calling a separate funciton
  22.     //echo EM_Events::output( array(
  23.    
  24.     //  echo the grouped events so we can have headers above each group
  25.     //      echo GROUPED events (I'm chosing 'daily' to get a DATE header,
  26.         //  this way I don't have to repeat the date for each entry under the same date)
  27.     //  This will accept all of the same arguments as EM_Events
  28.     echo em_events_list_grouped( array(
  29.         'orderby'=>'event_start_date',
  30.         'pagination'=>1,
  31.         'limit'=>10,
  32.         //  the header above each content grouping (immediately following the DATE HEADER)
  33.         'format_header' => $featuredEvtHeader,
  34.         //  format each event's display
  35.         'format'=>$featuredEvtFormat,
  36.         //  the footer below each content grouping (what closes each content group)
  37.         'format_footer' => $featuredEvtFooter,
  38.         //  determines how to group the events.
  39.             //  choices are 'daily', 'weekly', 'monthly', 'yearly'
  40.             //  each of those will place a header above that group
  41.             //  so 'daily' will put the date, then list all events under that date
  42.         'mode'=>'daily',
  43.     ) );
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement