wordpress怎么设置让文章不在首页显示

首页 » 知识分享 » wordpress怎么设置让文章不在首页显示

wordpress怎么设置让文章不在首页显示,办法就是用到query_posts函数,具体怎么实现,大家一起往下看。
打开index.php文件,找到如下代码:

  1. <?php if ( have_posts() ) : ?>

然后修改成:

  1. <?php if ( have_posts() ) : is_home() && query_posts($query_string .’&cat=-1′) ?>   

cat= 你想让出现在首页的分类ID,如果前面加个负号就单表某个分类的ID你不想让他显示在首页。

金蝶售后服务

发表回复

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