• Resolved chercka

    (@chercka)


    How could I filter the query to use a custom query for a specific taxonomy.

    Is there a way to hook into the carousel query?

Viewing 1 replies (of 1 total)
  • Thread Starter chercka

    (@chercka)

    Found a solution, hooking into the ‘wpc_query’ action. For example to update with a custom taxonomy like this:

    function custom_posts_query( $query ) {
            $query = array(
                'post_type' 		=> 'books',
    	    'tax_query' 		=> array(
    			array(
    			'taxonomy' => 'novels',
                            'field'    => 'slug',
    			'terms'    => 'romantic-novels',
    			),
    	     ),
            );
     
        return $query;
    }
    
    add_filter('wpc_query', 'custom_posts_query', 10, 2);
Viewing 1 replies (of 1 total)
  • The topic ‘Custom Query’ is closed to new replies.