This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • Menzer92Menzer92
    Participant

    You are the Boss!!! Thank you soooo much!!!!

    Menzer92Menzer92
    Participant

    Hi I saw these options after looking in the code and tried them but they did not work for me, but I will try again and let you know.

    Really appreciate your help

    in reply to: Category / Taxonomies not filtering on results #25399
    Menzer92Menzer92
    Participant

    Yeh that seems to have fixed it thanks. Please close

    Menzer92Menzer92
    Participant

    Ok I have gone away and thought about other ways, as a self taught developer I have only one mindest and that is to find the solution if I can and when I cant I turn to the expert but I think I found the solution, however, can you let me know if this is ok to run, it gives me the results I want and filters nicely at this stage

    add_filter("asp_query_args", "asp_query_args_change", 1, 2);
    
    function asp_query_args_change($args, $search_id) {
      // Do your stuff with the $args array
      // ....  
      // Then return
    	
       $eventdate= date('Y-m-d');
       $loop = new WP_Query(array(
       'post_type' => array('tribe_events'),
       'posts_per_page' => -1,
       'orderby' => 'meta_value',
       'order' =>'DESC',
       'fields' => 'ids',
       'post_status' => 'publish',
       'meta_query' => array(
          array(
             'key' => '_EventStartDate',
             'value' => $eventdate,
             'compare' => '>=')
          )
       )
    );
    
    $upcoming_events = $loop->posts;
    
    wp_reset_postdata();
    	
    	if($search_id == '1'){
    	$args['post_in'] = $upcoming_events;
    	}
    
      return $args;
    }

    Hope this helps others

Viewing 4 posts - 1 through 4 (of 4 total)