现在位置: 首页 > CMS知识 > 正文

wordpress排除某个分类下的文章

发布时间:2022 年 8 月 22 日

本文作者:帮建站

点击次数:357

<?php

query_posts('showposts=10&cat=-1');

//cat=-1为排除ID为1的分类下文章

while(have_posts()) : the_post(); ?>

<li>

<a href="<?php the_permalink() ?>"title="<?php the_title(); ?>"><?php the_title(); ?></a>

</li>

<?php

endwhile;

?>

问题本身还是很简单的,只是对于不熟悉的网友来说不知道什么原因,如果英语不太好的话,就以为自己买了个假主题了。问题本身还是很简单的,只是对于不熟悉的网友来说不知道什么原因,如果英语不太好的话,就以为自己买了个假主题了。


首页 在线 手机