0
点赞
收藏
分享

微信扫一扫

wordpress 调用指定文章列表

小桥流水2016 2022-08-22 阅读 82


<?php
$args=array(
'tag_id'=>123,//标签id
'posts_per_page'=>7,//每页显示数量
'paged'=>1//显示第1页
);
query_posts('cat=2859&orderby=new');
while(have_posts()): the_post();
?>
<div class="swiper-slide">
<a href="<?php the_permalink(); ?>" title="<?php the_title() ?>">
<?php the_post_thumbnail('thumbnail'); ?>//文章缩略图
<div class="viewInfo">查看详情 ></div>
<div class="tit-bar">
<div class="tit"><?php the_title() ?></div>
<div href="<?php the_permalink(); ?>" class="mores">查看详情 ></div>
</div></a>
</div>

<?php endwhile; ?>

<?php echo date("Y-m-d", strtotime($post->post_date))?>调用日期
<?php echo mb_strimwidth(strip_tags(apply_filters('the_content', $post->post_content)), 0, 100,'……'); ?>调用摘要

举报

相关推荐

0 条评论