Custom wordpress tooltip on category posts

I am trying to list category posts in WordPress and then show a tooltip on each post thumbnail in that category. The thumbnails are showing well but the tooltip only shows for the last post. I have the following code and i’m using Tipped for the tooltip. What I’m I doing wrong?

<?php
$args = array(
    'cat' => 11,
  'posts_per_page' => 100,
  'orderby' => 'title',
  'order' => 'ASC'
);
$the_query = new WP_Query( $args );
?> 
<?php if ( $the_query->have_posts() ) :
while ( $the_query->have_posts() ) :$the_query->the_post(); ?>


<span class="col-<?php the_ID(); ?>">
 <a href="<?php the_permalink(); ?>">
 <?php the_post_thumbnail( $size, $attr ); ?>
 </a>
 </span>
<div id="inline-<?php the_ID();?>" class="hidden">
  <?php the_content(); ?>          
</div>
<script type="text/javascript">
  jQuery(document).ready(function() {
    Tipped.create('.col-<?php the_ID(); ?>',
    'inline_content_1-<?php the_ID(); ?>',
    { inline: true, closeButton: true, hideOn: false});
  });
</script>
<?php endwhile;?>

Related posts

Leave a Reply