我们有时候需要自定义日志,控制某些文章不在首页显示。
打开当前theme的index.php找出如下代码:
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
在它的前面加上一句:
<?php query_posts(’cat=-1,-2,’); ?>
里面的“1 ” “2” 换成不想显示的日志的分类ID即可,需要隐藏更多的分类,用逗号隔开。
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我们有时候需要自定义日志,控制某些文章不在首页显示。
打开当前theme的index.php找出如下代码:
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
在它的前面加上一句:
<?php query_posts(’cat=-1,-2,’); ?>
里面的“1 ” “2” 换成不想显示的日志的分类ID即可,需要隐藏更多的分类,用逗号隔开。
发表回复