How do I use WP_Query to filter by post_excerpt

$loop = new WP_Query( array(
    'post_type' => 'portfolio',
    'paged' => $paged,
    'posts' => array(
        'post_excerpt' => 'ba'
    )
));

This does not filter for me.

Related posts

Leave a Reply

1 comment

  1. I tried by this solution:

    global $wpdb;
    $querystr = "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.post_excerpt = {$code}' AND $wpdb->posts.post_type = 'product'";     
    $posts = $wpdb->get_results($querystr);