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

这不适合我。

4

1 回答 1

1

我试过这个解决方案:

global $wpdb;
$querystr = "SELECT * FROM $wpdb->posts WHERE $wpdb->posts.post_excerpt = {$code}' AND $wpdb->posts.post_type = 'product'";     
$posts = $wpdb->get_results($querystr);
于 2018-02-04T17:53:08.287 回答