我想调用最新文章,代码如下图,为什么会出现重复调用?
wordpress吧
全部回复
仅看楼主
level 1
陈丶MrSir 楼主
代码:
<h3>ANGELBELLA LATEST POSTS</h3>
<div class="description">
<div class="row">
<div class="leftLine col-md-3 col-sm-3 hidden-xs"></div>
<div class="centerContent col-md-6 col-sm-6 col-xs-12">ARTICLE RESOURCES ON WIG, HUMAN HAIR AND SYNTHETIC HAIR</div>
<div class="rightLine col-md-3 col-sm-3 hidden-xs"></div>
<div class="clearfix"></div>
</div>
</div>
<?php
$args = array(
'post_type'=>'new',
'showposts' => 10,
'orderby' => modified,
);
query_posts($args);
while ( have_posts() ) : the_post();
?>
<?php $thumb_t = wp_get_attachment_image_src( get_post_thumbnail_id($post->ID), 'large' ); $url_t = $thumb_t['0'];?>
<div class="new-list">
<div class="new-info-box col-md-4 col-sm-4">
<a href="<?php echo get_permalink($post->ID) ?>" class="product-img">
<?php if($url_t) { ?>
<img width="350" height="153" src="<?php bloginfo('template_url')?>/timthumb.php?src=<?php echo $url_t ?>&w=350&h=153;&zc=1" alt="<?php the_title();?>">
<?php } else { ?>
<img width="350" height="133" src="<?php bloginfo('template_url')?>/timthumb.php?src=/wp-content/uploads/2018/07/product-bg.jpg&w=310&h=133;&zc=1" alt="<?php the_title();?>">
<?php } ?>
<h3><?php echo mb_strimwidth(get_the_title(), 0, 30, …); ?></h3>
<div class="case-description">
<p>
<?php echo mb_strimwidth(get_the_excerpt(), 0, 100, …); ?>
</p>
</div>
</a>
</div>
</div>
<?php endwhile;?>
<div class="clearfix"></div>
<?php wp_reset_query();?>
图片:
疑问,我只是循环调用所有的青色的文章,但是为什么首页部分又被重复盗用了一次?求大佬指教啊
2018年10月14日 13点10分 1
1