Custom Query – not working
-
I’m really stuck on this. Trying to add (any) basic custom query to an Elementor Post widget.
Issue – custom query is just ignored, widget displays all posts, regardless of custom query params.
screenshot of post widget setup
code snippet
function custom_query_test_02 ( $query ) { $query_args = array( 'post_status' => 'draft', ); $query = new WP_Query( $query_args ); return $query; } add_action( 'elementor/query/{$query_id}', 'custom_query_test_02' );
I’ve tried:
– adding code to functions.php and WPCode snippet
– different filters
– various syntax for setting $query (per Elementor Custom Filter docNothing works! No errors thrown, but it just ignores the custom query.`
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Custom Query – not working’ is closed to new replies.