Forum Replies Created
Viewing 4 posts - 1 through 4 (of 4 total)
-
AuthorPosts
-
January 22, 2020 at 8:56 pm in reply to: Get ID of post or page ASP shortcode is on and use in asp_query_args meta filter #25412
Menzer92
ParticipantYou are the Boss!!! Thank you soooo much!!!!
January 22, 2020 at 4:15 pm in reply to: Help with asp_query_args() filter not querying meta_key vale as dates #25400Menzer92
ParticipantHi 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
Menzer92
ParticipantYeh that seems to have fixed it thanks. Please close
January 18, 2020 at 9:43 pm in reply to: Help with asp_query_args() filter not querying meta_key vale as dates #25344Menzer92
ParticipantOk 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
-
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)