Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/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_Loops_Taxonomy_Custom Taxonomy_Args - Fatal编程技术网

Wordpress税务查询不工作?

Wordpress税务查询不工作?,wordpress,loops,taxonomy,custom-taxonomy,args,Wordpress,Loops,Taxonomy,Custom Taxonomy,Args,有人能告诉我为什么下面的WP查询不起作用吗 <?php if (is_page(10)) { $taxTerm = "restaurants"; } elseif (is_page(12)) { $taxTerm = "offices"; } elseif (is_page(14)) { $taxTerm = "hotels"

有人能告诉我为什么下面的WP查询不起作用吗

           <?php if (is_page(10)) {
                $taxTerm = "restaurants";
            } elseif (is_page(12)) {
                $taxTerm = "offices";
            } elseif (is_page(14)) {
                $taxTerm = "hotels";
            } elseif (is_page(16)) {
                $taxTerm = "flowers";
            } elseif (is_page(18)) {
                $taxTerm = "green-walls";
            }

                    $args = array(
                    'post_type' => 'gallery_items',
                    'tax_query' => array(
                        array(
                            'taxonomy' => 'industries',
                            'field'    => 'slug',
                            'terms'    => $taxTerm,
                        ),
                    ),
                    'order' => 'DESC',
                    'orderby'   => 'title',
                    'posts_per_page' => '5',
                    );

这不起作用怎么办?请更详细地介绍一下你收到的帖子,以及过滤的结果。同时发布你到目前为止所做的尝试,以获得你预期的结果,但没有成功吗?tax_查询不起作用,它应该按分类术语筛选我的库;var_dump($q->get_posts())收益率?考虑添加您注册自定义帖子和分类的代码,用于上下文。<代码> $TraceTys/Cord>可能不是字符串。我打赌你不小心发送了一个数组而不是字符串-仔细检查一下。它返回“array(0){}”?这怎么办?请更详细地介绍一下你收到的帖子,以及过滤的结果。同时发布你到目前为止所做的尝试,以获得你预期的结果,但没有成功吗?tax_查询不起作用,它应该按分类术语筛选我的库;var_dump($q->get_posts())收益率?考虑添加您注册自定义帖子和分类的代码,用于上下文。<代码> $TraceTys/Cord>可能不是字符串。我打赌您无意中发送了一个数组而不是字符串-请仔细检查。它返回“array(0){}”???