排除 Wordpress 中的帖子 [英] excluding posts in Wordpress

查看:24
本文介绍了排除 Wordpress 中的帖子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何在 Wordpress 中排除帖子.例如.我有一个字符串

I wondered how I could exclude posts in Wordpress. E.g. I have a string

$exclude_ids (= "4,5,6") or (="-4,-5,-6")

我想阻止这些帖子出现.我该怎么做?

and I would like to prevent these posts from showing up. How would I do that?

我已经试过了:

query_posts('p=' . $exclude_ids);

但这并没有真正奏效,我在 google 上也没有真正找到有关此主题的任何信息.

but that didn't really work out and I didn't really find any information regarding this topic on google.

干杯

推荐答案

这是来自 文档的相关信息:

'post__not_in' => 数组(6,2,8) -排除,让您指定帖子不检索的 ID

'post__not_in' => array(6,2,8) - exclusion, lets you specify the post IDs NOT to retrieve

这篇关于排除 Wordpress 中的帖子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆