Events Manager
[resolved] Get events for location (3 posts)

  1. ciccimanolesta
    Posted 4 years ago #

    I'm trying to get events list for single location but in shortcode/api documentation there isn't this possibilities.



  2. ciccimanolesta
    Posted 4 years ago #

    There isn't this (simple) possibility.

    I Have do it manually:

    $dati = EM_Locations::get( array('post_id'=>$post->ID) );
                                $query = "SELECT event_slug, recurrence_id, event_id, event_end_date, event_name FROM wp_em_events WHERE location_id = ".$dati[0]->location_id." and event_end_date >= '".date("Y-m-d")."'
                                        AND event_status = 1 AND event_private = 0 AND (recurrence_id = 0 or recurrence_id is null) ORDER BY event_end_date ASC";
                                $result = mysql_query( $query );
                                if (mysql_num_rows($result)>0) {
                                    <div class="events">
                                        <h2>Next events</h2>
                                    // scarto quelli ripetuti
                                    while ($evento = mysql_fetch_assoc($result)) {
                                        echo 'until '.date("F j, Y", strtotime($evento['event_end_date'])).' - <a href="/events/'.$evento['event_slug'].'" title="See event &quot;'.$evento['event_name'].'&quot;">'.$evento['event_name'].'</a><br />';
  3. Marcus
    NetWebLogic Support
    Plugin Author

    Posted 4 years ago #

    you can use shortcodes e.g.

    [events_list location=x]

    or also use the #_LOCATIONNEXTEVENTS placeholder

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Events Manager
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic