• Resolved ratmalwer

    (@ratmalwer)


    Hi

    I call the eventmanager like this:
    echo EM_Events::output( array(‘limit’=>5) );

    Now I want in addition of this (alll events) add all events whith the category = ‘Important’ sorted by Date if possible.
    This shoud show in addition of the limit.

    Is here a way to do this?
    PHP-Code with a brief explanation welcome.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter ratmalwer

    (@ratmalwer)

    As nobody had a solutuin I foud a workaround.
    Here my solution. Maybe it helps someone 🙂

    $ev1 = EM_Events::get( array('limit'=>5) );  //newest Events
    $ev2 = EM_Events::get( array('category'=>'Wichtig') );  //Important Events
    $ev = array_merge( $ev1, $ev2 );  //merge
    $postids = array();
    foreach( $ev as $event ) {
    	$postids[]=$event->post_id; //create a new query only of the posts
    }
    $uniqueposts = array_unique($postids); //remove duplicate postids						
    $args = implode(",", $uniqueposts);
    echo EM_Events::output( array('post_id'=>$args));  //events output
    Plugin Support angelo_nwl

    (@angelo_nwl)

    Thank you for sharing. this will surely help others.

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

The topic ‘Add more then one searchargument’ is closed to new replies.