Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.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_Search_Plugins_Listings - Fatal编程技术网

Wordpress 使用插件显示特定分类法的帖子

Wordpress 使用插件显示特定分类法的帖子,wordpress,search,plugins,listings,Wordpress,Search,Plugins,Listings,我正在为这个属性制作一个插件。创建了自定义帖子类型。现在我正在使用流动代码展示基于分类法的文章 它在主题文件中运行良好,但在插件文件中不起作用 $args = array( 'post_type' => CUSTOM_POST__NAME, 'post_status' => 'publish', 'tax_query' => array( array( 'taxonomy

我正在为这个属性制作一个插件。创建了自定义帖子类型。现在我正在使用流动代码展示基于分类法的文章 它在主题文件中运行良好,但在插件文件中不起作用


$args = array(
        'post_type' => CUSTOM_POST__NAME,
        'post_status' => 'publish',

        'tax_query' => array(
            array(
                'taxonomy' => PROPERTY_STATE,
                'field' => 'name',
                'terms' => 'state-name',
            ),
        ),
    );

    $loop = new WP_Query($args);