• Resolved thegreyspot

    (@thegreyspot)


    hi!

    I am trying to get a list of events from blog_id’s 2 and 3. I have the following code:

    <?php
                      $blogs = "2,3";
                      $events= EM_Events::get('limit=3&blog='. $blogs);
                      //print_r($menu_posts);
                      if(!empty($events)){
                          outputEventsList($events);
                      }
                    ?>

    However, I only get returned blog 2. (Each blog has one event in it)

    Also, I cant seem to get the “array” argument to work. I want it to return the object as an array so that I can do event->event_name; I have tried:

    $events= EM_Events::get('limit=3&array=true&blog='. $blogs);
      $events= EM_Events::get('limit=3&array=1blog='. $blogs);

    But I had no luck.

    Michael

    https://www.ads-software.com/plugins/events-manager/

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Support angelo_nwl

    (@angelo_nwl)

    it should be something like blog=”2,3″ (separated by comma) – did you try something like this?

    Thread Starter thegreyspot

    (@thegreyspot)

    Ummm, thats what I have?

    Have you tried entering that parameter manually rather than using a variable to ensure it’s passed correctly?

    As for your array parameter – you have a syntax error. That same syntax error might be why the blogs parameter isn’t working for you.

    Thanks

    Thread Starter thegreyspot

    (@thegreyspot)

    Yes I have tried:
    $events= EM_Events::get('limit=3&blog="2,3"');

    As for your array parameter – you have a syntax error. That same syntax error might be why the blogs parameter isn’t working for you.

    Maybe you can tell me what the syntax error is? I don’t see it.

    Thanks

    Have you tried using the standard events_list shortcode in a normal page to make sure that works?

    Thread Starter thegreyspot

    (@thegreyspot)

    Hmm not sure what you mean? I have a feeling the plugin only supports one blog io for that blog variable… anyone else know the answer to this?

    Plugin Support angelo_nwl

    (@angelo_nwl)

    did you try something like

    $events= EM_Events::get( array( 'limit' => 3, 'blog' => '2,3' ) );
    Thread Starter thegreyspot

    (@thegreyspot)

    That worked!!! Thanks so much ?? +1! I should have just tried it…

    Plugin Support angelo_nwl

    (@angelo_nwl)

    glad it worked, thanks for the update.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Include multiple blogs in EM::events get()’ is closed to new replies.