So I tried to make a custom post type called ‘showcase’ and created a few posts in this custom post type. The problem is that when I click on a ‘product’ it should showup in a lightbox instead of going to the thumbnail url.

This is the code I am using:

<section id="showcase">
    <?php
        $args = array( 'post_type' => 'showcase', 'posts_per_page' => -1 ); $the_query = new WP_Query( $args );
        if ( $the_query->have_posts() ) :
        $it = 0;
        while ( $the_query->have_posts() ) : $the_query->the_post();
        $terms = get_the_terms( $post->ID , 'showcase_category');
        $it ++;
        if ($it == 6) {
            echo '</section><div class="cta-block"><h2>Live model drawing</h2><p>Drawing from a live model, gives you the opportunity to draw what you see instead of drawing what you think about.</p><a href="/kerkeni/courses/" class="cta-button">View courses</a></div><section id="showcase">';
        }
    ?>
    <a class="entry-showcase" href="<?php the_post_thumbnail_url(); ?>" title="<?php the_title_attribute(); ?>">
        <?php the_post_thumbnail( 'medium' ); ?>
    </a>
    <?php wp_reset_postdata();
    endwhile; else :
    endif; ?>
</section>

Also, I tried using a few plugins which automaticly detect jpg, gif etc but for some reason they are not working for thumbnail images.

Some plugins I tested:

Easy FancyBox
Responsive Lightbox
Simple Lightbox

Thanks in advance (:

Read more here: WordPress a tag show thumbnail image in lightbox with plugin


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: