Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress。只获取没有特色图片的帖子_Wordpress - Fatal编程技术网

Wordpress。只获取没有特色图片的帖子

Wordpress。只获取没有特色图片的帖子,wordpress,Wordpress,我知道,我们可以使用 'meta_query' => array( array( 'key' => '_thumbnail_id'), ) 在 但是如果没有特色图片,我如何获得帖子呢?试试这个 $args = array( 'meta_query' => array( array( 'key' => '_thumbnail_id', 'value' => '?', 'compare' => '

我知道,我们可以使用

'meta_query' => array(
    array( 'key' => '_thumbnail_id'), 
)

但是如果没有特色图片,我如何获得帖子呢?

试试这个

$args = array(
  'meta_query' => array(
     array(
       'key' => '_thumbnail_id',
       'value' => '?',
       'compare' => 'NOT EXISTS'
     )
  ),
);
$new_query = new WP_Query( $args );

令人惊叹的!非常感谢!你可以使用这个插件