我使用以下代码为每篇文章显示“社交媒体羽毛”小部件,但图标仅显示在第一篇文章中,其余部分则不显示:
$paged = (get_query_var(\'paged\' )) ? get_query_var(\'paged\') : 1;
$args = array(
\'post_type\' => \'events\',
\'posts_per_page\' => 2,
\'paged\' => $paged
);
$loop = new WP_Query( $args );
if ($loop->have_posts()) : while ( $loop->have_posts() ) : $loop->the_post();
$count=0;
?>
<div class="row event-list my-events <?php echo $type[0]->name; ?> ">
<div class="col-lg-9 col-md-9 col-sm-8 col-xs-12 paddingdel-l">
<h5><?php the_title( ); ?></h5>
<div class="row">
<div class="co-lg-5 col-md-5 col-sm-5 col-xs-6 event-list-right">
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2 paddingdel-l pad0">
<img src="<?php echo IMAGES; ?>/share.png" class="img-responsive" alt="" />
</div>
<div class="col-lg-8 col-md-8 col-sm-8 col-xs-8 social">
<?php get_sidebar(\'share\'); ?>
</div>
</div>
</div>
</div>
</div>
<?php
endwhile; endif;