0

I'm using the following code to display the "Social Media Feather" widget for each post, but icons are only displayed for the first post and not the rest:

$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;
0

did it with shortcode. Instead of using <?php get_sidebar('share'); ?> used <?php echo do_shortcode('[feather_share]' ); ?> for sharing icons .I guess a widget can only be displayed for one time on a page

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.