Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial


Lukas Albrecht
Lukas Albrecht
Courses Plus Student 11,843 Points

Multiple Post Thumbnails and lightbox

I need help with implementing a lightbox to the featured image in a blog post. I use the Plugin "Multiple Post Thumbnails" to display more as one image for a blogpost. But I also need a lightbox for each image on a single view.

<a  class="post-thumbnail" href="<?php  
        if ( is_single() ) :
            echo // ### What I have to paste here to get the image url? 
        else :
            echo esc_url( get_permalink());
        <?php if (class_exists('MultiPostThumbnails')) : MultiPostThumbnails::the_post_thumbnail(get_post_type(), 'zweites-image'); endif; ?>

What I have to paste in the first if-statement to get the image url? And is the Plugin "CSS3 Lightbox" the right choice?