wordpress开发之排除于输出非置顶文章代码
<?php $args = array( 'post_type' =>'post', 'post__in'=>get_option( 'sticky_posts' ) //只输出置项的文章 //'post__not_in'=>get_option( 'sticky_posts' ) //排除置项的文章 ); $query = new WP_Query( $args ); $i=1; while ($query->have_posts()):$query->the_post(); ?> <a href="<?php the_permalink(); ?>"><?php the_title(); ?></a> <br /> <?php $i++; endwhile; ?>
转载请注明出处: 沐辰客栈
本文的链接地址: https://qqm90.cn/wordpress/477.html
发表评论 取消回复