<?php
$count = 1;
$display_categories = array(1);
foreach ($display_categories as $category) {
?>
<?php query_posts("showposts=5&cat=$category")?>
<?php while (have_posts()) :the_post(); ?>
<?php if($count==1){ ?>
<li class="">
<div>
<small class=""><?php the_time('Y-m-d') ?></small>
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
</div>
<p class=""><?php echo mb_strimwidth(strip_tags(apply_filters('the_content',
$post->post_content)), 0, 200,"……"); ?></p>
</li>
<?php }else{ ?>
<li class="">
<small class=""><?php the_time('Y-m-d') ?></small>
<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php echo
mb_strimwidth(get_the_title(), 0, 80, '…'); ?></a>
</li>
<?php } $count++;endwhile; ?>
<?php } wp_reset_query();?>
wordpress 调用第一篇文章 不同样式
Published
Categorized as 经典代码
免责声明:
本站所有内容来源于互联网。如果本站部分内容侵犯您的权益,请您告知,站长会立即处理。
本站力争为大家提供最好最全的WordPress模板,本站所有WordPress模板都是站长从国内外大小网站收集而来,旨在为朋友们在工作或学习时提高效率、节省时间。
站内所有资源仅供学习与参考,请勿用于商业用途,否则产生的一切后果将由您自己承担!