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

Wordpress - 使用'get_post'一次只选择两个指定猫中的帖子

I am trying to use 'get_posts' to pick up posts that are in two categories. Currently I am using this: $myposts = get_posts('numberposts=1&category=4&category=7');

This picks up posts that are either in category 4 or 7. The posts I want to pick up must be in both categories at once. Any suggestions?

Use this

$myposts = get_posts('numberposts=1&category=4,7');

近期文章

  • 连接两个表(通过链接),一个可能产生多行,一起成为一个结果
  • Wordpress [标题]处理
  • ajax和多个复选框
  • JQuery警报问题?
  • php image create和jquery对话框
  • 如何测试facebook应用程序?
  • 从php调用javascript / ajax函数
  • 字符串格式化 - 替换php中的代码
  • 如何将两个变量与查询中的id表值进行比较?
  • 根据信息着色地图(使用谷歌地图api或其他api)
  • PHP解析csv列表并将每条记录插入到wordpress用户数据库中
  • 我在表单中维护值的简单PHP函数不起作用。 真的是新手!
  • 这段代码有什么问题:来自远程压缩文件的file_get_contents和解压缩到本地目录
  • 如何将变量推送到ajax的web客户端?
  • 我如何获取来自多个网站的最近十篇博文的标题,日期和网址?
  • Magento:每个商店加载属性
  • 更改MySQL列,其值为自动递增
  • 使用php自动生成播放列表
  • PHP - 如何创建此SOAP XML请求?
  • PHP / Ajax / jQuery数据提交方法

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华