WordPress列表根据序列号递增显示不同颜色
1 2 3 4 5 6 7 | <?php $cmntCnw = 1; query_posts( $query_string . '&orderby=date&showposts=10&ignore_sticky_posts=1' );while(have_posts()) : the_post(); ?> <?php if($cmntCnw <3) { ?> <li class="clearfix topthree"> <div class="top_number"> <?php echo($cmntCnw++); ?></div> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" rel="bookmark" target="_blank"> <?php the_title(); ?></a></li> <?php } else { ?> <li class="clearfix"> <div class="top_number"> <?php echo($cmntCnw++); ?></div> <a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>" rel="bookmark" target="_blank"> <?php the_title(); ?></a></li> <?php } ?> <?php endwhile;wp_reset_query() ?> |
来源:邦林织梦(微信/QQ号:909912499),欢迎分享本文,转载请保留出处!部分内容来自网络,如有侵权请联系删除处理!
本站提供代码修改,dedecms,WordPress仿站二次开发 / PHP网站建设以及SEO优化等网络营销推广等服务。
如有需要请加QQ: 909912499