wordpress在调用分类下文章时,有时需要排除调用某个分类的文章,下面的这段代码,就可以轻松实现不调用特定ID的分类内容。
<?phpquery_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; ?>
原文
https://www.zhanyes.com/code/6280.html