Notice: Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the jquery handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.) in /mnt/webroot/wandoer/code.wandoer/wp-includes/functions.php on line 6260
Wordpress 设置分类文章在主页不显示 – 豌豆

WordPress 设置分类文章在主页不显示

作者:

在

我们有时候需要自定义日志,控制某些文章不在首页显示。

打开当前theme的index.php找出如下代码:

<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>

在它的前面加上一句:

<?php query_posts(’cat=-1,-2,’); ?>

里面的“1 ” “2” 换成不想显示的日志的分类ID即可,需要隐藏更多的分类,用逗号隔开。

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注