我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

Wordpress获取多个类别的帖子

I'm tring to use 'category__and' filter in WP_Query function to get some posts out and I get nothing!

here's my code:

$query_args = array( 'category__and' => array(44,43), 'posts_per_page' => 9, 'no_found_rows' => 1, 'post_status' => 'publish', 'post_type' => 'product');
$r = new WP_Query($query_args);
if ($r->have_posts()) { ............

Important note: I have posts in both categories 44&43. When I remove the 'category__and' I get all posts.

近期文章

  • 提高文件写入速度
  • 亚马逊产品广告API PHP显示图像
  • mod_jk报错,哪位大侠帮忙解答下
  • PHP邮件脚本在使用jQuery时不发送电子邮件.ajax()
  • 这段代码中的错误是什么?它总是在其他地方
  • PHP CURL - 在抓取时存储和使用cookie的问题
  • 使用wordpress重写规则时忽略特定页面
  • 如何删除循环中的行或任何其他方法以显示如下所示
  • 我可以将Expression Web 4的预览窗格用于<?php include ...?>指令吗?
  • 如何在详细订单页面中翻译性别
  • too long
  • 我看不到一些PHP错误[重复]
  • 使用COM“InternetExplorer.Application”对象保存.html文件
  • 注销和access_token
  • 将Google帐户与youtube帐户相关联
  • 自定义排序/向下Yii CGridView按钮
  • 实时程序
  • iCalendar不会发送更改时间或接收与会者回复
  • 尝试实例化JBilling WSDL连接时发生错误
  • Expedia API集成

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华