Title: Programming event list
Last modified: August 24, 2016

---

# Programming event list

 *  [makcooney](https://wordpress.org/support/users/makcooney/)
 * (@makcooney)
 * [11 years ago](https://wordpress.org/support/topic/programming-event-list/)
 * Hi Barry thanks for responding to my personal email and as requested have brought
   it to the forum.
 * I have got this far:
 * function sie_events(){
    $thisDate = date(“Y-m-d”); $thisDate7 = date(“Y-m-d”,
   strtotime(“+1 week”));
 *  $event_posts = event_embed()->obtain( [
    ‘from’ => $thisDate, ‘to’ => $thisDate7]);
   echo($thisDate . ” to “. $thisDate7 . ““); // Now you can iterate through the
   results and do // whatever you like foreach ( $event_posts as $single_event ){
   $url = get_permalink( $single_event->ID ); $title = get_the_title( $single_event-
   >ID ); echo ‘event: [‘ . $title . ‘](https://wordpress.org/support/topic/programming-event-list/&apos; . $url . &apos;?output_format=md)‘;
 *  }
 * }
    add_shortcode(‘SiE_Events’, ‘sie_events’);
 * I do get the echo of the date come up: 2015-05-12 to 2015-05-19 but no events
   to which I know there is at least 25 for the date period.
    I’d also like to add
   start date to the event.
 * Thanks in advance
 * [https://wordpress.org/plugins/event-rocket/](https://wordpress.org/plugins/event-rocket/)

Viewing 9 replies - 1 through 9 (of 9 total)

 *  Thread Starter [makcooney](https://wordpress.org/support/users/makcooney/)
 * (@makcooney)
 * [11 years ago](https://wordpress.org/support/topic/programming-event-list/#post-6122295)
 * The HTML has disappeared from above
 *     ```
       function sie_events(){
       	$thisDate = date("Y-m-d");
       	$thisDate7 = date("Y-m-d",strtotime("+1 week"));
   
       	$event_posts = event_embed()->obtain( [
       	'from' => $thisDate,
       	'to'   => $thisDate7
       	] );
       	echo($thisDate . " to ". $thisDate7 . "<br />");
       // Now you can iterate through the results and do // whatever you like
           foreach ( $event_posts as $single_event ) {
           $url   = get_permalink( $single_event->ID );
           $title = get_the_title( $single_event->ID );
          echo 'event: <a href="' . $url . '">' . $title . '</a>';
   
        }
   
       }
       add_shortcode('SiE_Events', 'sie_events');
       ```
   
 *  Plugin Author [Barry](https://wordpress.org/support/users/barryhughes-1/)
 * (@barryhughes-1)
 * [11 years ago](https://wordpress.org/support/topic/programming-event-list/#post-6122353)
 * Thanks makcooney – you’ve actually hit upon a bug here. Hold tight while I make
   a correction.
 *  Plugin Author [Barry](https://wordpress.org/support/users/barryhughes-1/)
 * (@barryhughes-1)
 * [11 years ago](https://wordpress.org/support/topic/programming-event-list/#post-6122355)
 * 2.5.2 should be available shortly: as soon as it is, please try it out alongside
   your custom shortcode 🙂
 *  Thread Starter [makcooney](https://wordpress.org/support/users/makcooney/)
 * (@makcooney)
 * [11 years ago](https://wordpress.org/support/topic/programming-event-list/#post-6122394)
 * great stuff – update works
 * So how do I get the start date and limit to 50 please?
 * Thanks for your help Barry
 *  Thread Starter [makcooney](https://wordpress.org/support/users/makcooney/)
 * (@makcooney)
 * [11 years ago](https://wordpress.org/support/topic/programming-event-list/#post-6122397)
 * and to be really annoying, can it be Day of week (full), date Month?
 *  Thread Starter [makcooney](https://wordpress.org/support/users/makcooney/)
 * (@makcooney)
 * [11 years ago](https://wordpress.org/support/topic/programming-event-list/#post-6122406)
 * OK kinda figured it. Like I say novice.
 * The only part that dont work is the date_format. Maybe guidance there is possible.
   Thanks again for your help
 *     ```
       function sie_events(){
       	$thisDate = date("Y-m-d");
       	$thisDate7 = date("Y-m-d",strtotime("+1 week"));
   
       	$event_posts = event_embed()->obtain( [
       	'from' => $thisDate,
       	'to'   => $thisDate7,
       	'limit' => '50'
       	] );
       	echo($thisDate . " to ". $thisDate7 . "<br />");
       // Now you can iterate through the results and do // whatever you like
           foreach ( $event_posts as $single_event ) {
           $url   = get_permalink( $single_event->ID );
           $title = get_the_title( $single_event->ID );
       	$datd = tribe_get_start_date( $single_event->ID, false, get_option( 'date_format', 'l j F' ) );
          echo 'event: <a href="' . $url . '">' . $datd . " " . $title . '</a> <br/>';
   
        }
       }
       add_shortcode('SiE_Events', 'sie_events');
       ```
   
 *  Plugin Author [Barry](https://wordpress.org/support/users/barryhughes-1/)
 * (@barryhughes-1)
 * [11 years ago](https://wordpress.org/support/topic/programming-event-list/#post-6122407)
 * > So how do I get the start date and limit to 50 please?
 * The start date of each event? Use [tribe_get_start_date()](http://theeventscalendar.com/functions/tribe_get_start_date)
   for that. To specify a limit just add a limit argument in the array you are passing
   to **event_embed()->obtain()** 🙂
 * > and to be really annoying, can it be Day of week (full), date Month?
 * It can be whatever you want! You can learn about date formatting in PHP (which
   is what [tribe_get_start_date()](http://theeventscalendar.com/functions/tribe_get_start_date)
   uses under the hood) over here:
 * [php.net/manual/en/function.date.php](http://php.net/manual/en/function.date.php)
 *  Thread Starter [makcooney](https://wordpress.org/support/users/makcooney/)
 * (@makcooney)
 * [11 years ago](https://wordpress.org/support/topic/programming-event-list/#post-6122409)
 * Sorted 😛
 * `$datd = tribe_get_start_date( $single_event->ID, false, 'l jS F' );`
 * No need for the get_option part
 * Barry, your a star.
 *  Plugin Author [Barry](https://wordpress.org/support/users/barryhughes-1/)
 * (@barryhughes-1)
 * [11 years ago](https://wordpress.org/support/topic/programming-event-list/#post-6122410)
 * Happy to help 🙂

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Programming event list’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/event-rocket_dacd8c.svg)
 * [Event Rocket](https://wordpress.org/plugins/event-rocket/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/event-rocket/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/event-rocket/)
 * [Active Topics](https://wordpress.org/support/plugin/event-rocket/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/event-rocket/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/event-rocket/reviews/)

 * 9 replies
 * 2 participants
 * Last reply from: [Barry](https://wordpress.org/support/users/barryhughes-1/)
 * Last activity: [11 years ago](https://wordpress.org/support/topic/programming-event-list/#post-6122410)
 * Status: not resolved