$loop = new WP_Query( array(
'post_type' => 'portfolio',
'paged' => $paged,
'posts' => array(
'post_excerpt' => 'ba'
)
));
这不适合我。
答案 0 :(得分: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);