<style>
.tooltips {
  position: relative;
  display: inline-block;
}

.tooltips .tooltiptext {
  visibility: hidden;
  width: 140px;
  background-color: #555;
  color: #fff;
  text-align: center;
  border-radius: 6px;
  padding: 5px;
  position: absolute;
  z-index: 1;
  bottom: 150%;
  left: 50%;
  margin-left: -75px;
  opacity: 0;
  transition: opacity 0.3s;
}

.tooltips .tooltiptext::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: #555 transparent transparent transparent;
}

.tooltips:hover .tooltiptext {
  visibility: visible;
  opacity: 1;
}

.pagination {
   clear:both;
   position:relative;
   font-size:11px; /* Pagination text size */
   line-height:13px;
   float:right; /* Pagination float direction */
}
.pagination span, .pagination a {
   display:block;
   float:left;
   margin: 2px 2px 2px 0;
   padding:6px 9px 5px 9px;
   text-decoration:none;
   width:auto;
   color:#fff; /* Pagination text color */
   background: #555; /* Pagination non-active background color */
   -webkit-transition: background .15s ease-in-out;
   -moz-transition: background .15s ease-in-out;
   -ms-transition: background .15s ease-in-out;
   -o-transition: background .15s ease-in-out;
   transition: background .15s ease-in-out;
}
.pagination a:hover{
   color:#fff;
   background: #6AAC70; /* Pagination background on hover */
}
.pagination .current{
   padding:6px 9px 5px 9px;
   background: #6AAC70; /* Current page background */
   color:#fff;
}
.content_hero_container .btn{padding:5px !important;}
</style>


<h1 style="padding-left: 15px;">1-Click Post Index</h1>

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

<div class="content_hero_container">
<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="20%" style="text-align: inherit;font-weight: 700;">Action<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>
                <input type="hidden" value="<?php echo get_permalink(); ?>" id="myInputs<?php echo $a; ?>">
                <div class="tooltips">
                <button id="btnCopy<?php echo $a; ?>" class="btn btn-success">
                <span class="tooltiptext" id="myTooltip<?php echo $a; ?>">Copy</span>
                copy
                </button>
                </div>
                <script>
                jQuery('#btnCopy<?php echo $a; ?>').click(function() {
                var dummyContent = jQuery('#myInputs<?php echo $a; ?>').val();
                var dummy = jQuery('<input style=opacity:0;position:fixed;>').val(dummyContent).appendTo('body').select();
                 document.execCommand('copy');
                 
                 var tooltip = document.getElementById("myTooltip<?php echo $a; ?>");
                  tooltip.innerHTML = "Copied";
                  
                });
                
                </script>
                <!--<input type="submit" class="btn btn-success" value="Copy"> -->
                <a href="https://search.google.com/search-console/welcome" class="btn btn-success" target="_blank" >Google Master Console</a>
            </td>
        </tr>
        <?php
        $a++;
        endwhile;
        ?>
      </tbody>
    </table>
	<?php
	    if (function_exists("pagination_ch")) 
        {
          pagination_ch($result->max_num_pages,$paged);
        }  
        endif; 
	?>	
</div>
</div>