wordpress 调用分类列表 不同的列表样式
我们在WordPress CMS网站中常常看到同一分类调用不同的文章样式,前面几篇和后面的文章显示不同的样式
通过以下代码即可实现这个功能:
12345678910111213<?php query_posts("showposts=2&cat=1"); ?><?php while (have_posts()) : the_post(); ?><div > <a href="<?php%20the_permalink()%20?>"><img src='<?php echo catch_first_image() ?>' border='0' width='120' height='90' alt='<?php the_title_attribute(); ?>'></a><h4><a href="<?php%20the_permalink()%20?>"target="_blank"><?php the_title_attribute(); ?></a></h4><p><?php echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 80,"..."); ?></p> </div><?php endwhile; ?><ul ><?php query_posts("showposts=3&cat=1&offset=2"); ?><?php while (have_posts()) : the_post(); ?><li><span > <a href="<?php%20the_permalink()%20?>" targent="_blank" ><?php the_title_attribute(); ?></a> </span></li><?php endwhile; ?>
以上代码是调用分类id为1的列表
前面两篇文章是上面图片展示的样式,之后的文章以列表的形式显示!
webacc.exe是什么文件?webacc.exe是不是病毒
WINSYS.vbs是什么文件?WINSYS.vbs是不是病毒
winssh.exe是什么文件?winssh.exe是不是病毒
wt.exe是什么文件?wt.exe是不是病毒
winsysetm.exe是什么文件?winsysetm.exe是不是病毒
winstrve.exe是什么文件?winstrve.exe是不是病毒
winsysupd7.exe是什么文件?winsysupd7.exe是不是病毒
winsysupd.exe是什么文件?winsysupd.exe是不是病毒
winsysupd2.exe是什么文件?winsysupd2.exe是不是病毒
winsysupd8.exe是什么文件?winsysupd8.exe是不是病毒