Get the event content

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

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

    Hi Stephen,
    I’m querying events with eo_get_events like this:

              foreach ($ahevents as $event):
               //Check if all day, set format accordingly
    $title_main_event = get_the_title($event->ID);
               printf(
         %s   %s %s %s. %s',
                  get_permalink($event->ID),
                  get_the_title($event->ID),
                  eo_get_the_start( 'j. F Y', $event->ID, $event->occurrence_id ),
                  eo_get_the_start( 'H.i', $event->ID, $event->occurrence_id ),
                  eo_get_venue_name(eo_get_venue($event->ID)),
                  get_the_content($event->ID)
               );
    

    Unfortunately I’m not able to get the content, neither get_the_content nor eo_get_the_content work. How can I display the event’s content?

    Thank you!

    Oliver Flueckiger
    #25775

    eo_get_events() is essentially get_posts() so you can’t use the functions. They are only suitable when using a WP_Query loop.

    You can either use WP_Query instead (see: http://docs.wp-event-organiser.com/querying-events/overview/) or you can create a function to get the content of the event: http://wordpress.stackexchange.com/a/110461)

    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.