WordPress置顶文章排除只输出非置顶文章和是否是置顶文章is_sticky()判断
如果是置顶文章就排除不显示的方法。代码如下:
<?php if (have_posts()) : ?> <?php while (have_posts()) : the_post(); ?> <?php if(!is_sticky()){ ?> <li><a href="<?php the_permalink() ?>"><?php the_title(); ?></li> <?php }?> <?php endwhile;?> <?php endif; ?>
WordPress置顶文章判断
is_sticky()
转载请注明出处: 沐辰客栈
本文的链接地址: https://qqm90.cn/wordpress/476.html
发表评论 取消回复