I have a custom page template like this, which opens some post thumbnails in a grid, which I’ve linked them by link tag to the image url. I also use Responsive Lightbox plugin by dFactory so there’s an option to check as: Enable for wordpress link images. Plugin needs the images to have rel=”lightbox” which i used in my html tag, but it does not work. what’s wrong with my code?
‘title_li’ => ”,
$cats = wp_list_categories( $args );
‘post_type’ => ‘drawing’,
$the_query = new WP_Query($args);
<?php if ($the_query->have_posts() ): while ($the_query->have_posts() ):$the_query->the_post(); ?>
<div class=”painting col-md-3 col-sm-6″ >
<a rel=”lightbox” class=”lightbox” href=”<?php the_post_thumbnail_url( ‘full’); ?>” >
<div class=”painting-image” >
<?php the_post_thumbnail(‘drawing-thumbnail’); ?>
<?php endwhile; ?>
<?php endif; ?>
Read more here:: how to add rel selector to wp featured image for lightbox?