<h1 style="padding-left: 15px;margin-top:1em;">Social Media Share</h1>
<?php
global $wpdb;



$paged = (isset($_GET['paged']) && $_GET['paged']!=''?$_GET['paged']:1);
$args = array(
'post_type'=> 'post',
'orderby'    => 'ID',
'post_status' => 'publish',
'order'    => 'DESC',
'posts_per_page' => 10,
'paged' => $paged
);
$result = new WP_Query( $args );?>

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="panel-body table-responsive">
    <table class="table table-striped widefat" style="width:100%;">
      <thead>
        <tr>
          <th style="text-align: inherit;font-weight: 700;">Post Title</th>
          <th style="text-align: inherit;font-weight: 700;">Post Url</th>
          <th width="17%" style="text-align: inherit;font-weight: 700;">Share<h>
        </tr>
      </thead>
      <tbody>
        <?php 
		$a = 0; 
		if ( $result-> have_posts() ) :
        while ( $result->have_posts() ) : $result->the_post(); 
        ?>
        <tr>
            <td><?php echo get_the_title(); ?></td>
            <td><?php echo get_permalink(); ?></td>
            <td>
                <?php 
				$image = wp_get_attachment_image_src( get_post_thumbnail_id( $result->ID ));
                if(isset($image[0]) && $image[0]!=''){
					$image[0] = $image[0];
				}else{
					$image[0] = WPCH_PLUGIN_URL . 'assets/img/click.png';
				} 				
				?>
			    <a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=<?php echo urlencode(get_permalink()); ?>&picture=<?php echo $image[0]; ?>"><i class="fa fa-facebook-square" style="font-size:30px"></i></a>
			    <a target="_blank" href="https://twitter.com/intent/tweet/?url=<?php echo urlencode(get_permalink()); ?>"><i class="fa fa-twitter-square" style="font-size:30px"></i></a>
			    <a target="_blank" href="https://pinterest.com/pin/create/button/?url=<?php echo urlencode(get_permalink()); ?>&media=<?php echo $image[0]; ?>&description=<?php the_title();?>"><i class="fa fa-pinterest-square" style="font-size:30px"></i></a>
			    <!--<a target="_blank" href="https://www.tumblr.com/share/link?posttype=link&url=<?php echo urlencode(get_permalink()); ?>&description=<?php echo the_title(); ?>"><i class="fa fa-tumblr-square" style="font-size:30px"></i></a>-->
			    <a target="_blank" href="https://www.linkedin.com/shareArticle?mini=true&url=<?php echo urlencode(get_permalink()); ?>&submitted-image-url=<?php echo $image[0]; ?>"><i class="fa fa-linkedin-square" style="font-size:30px"></i></a>
            </td>
        </tr>
        <?php
        $a++;
        endwhile;
        ?>
      </tbody>
    </table>
    <?php
	if (function_exists("pagination_ch")){
        pagination_ch($result->max_num_pages,$paged);
    }  
    endif;
	?>
</div>