Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Archetyped

    (@archetyped)

    Hi, it looks like your code sample got mangled when posted. Please wrap the code in <pre> tags so that I can see exactly what code you are using.

    Thanks.

    Thread Starter jamesdonegan

    (@jamesdonegan)

    Sorry about that! So each pass through the loop generates this…

    <h4 class="show-list">
        <a>" class="thumbnail-link" title="<image-title>">
            <img width="150" height="150" src="https://localhost:8888/SRO_Marketing/wp-content/uploads/2017/06/51D8JNKPJ3L._SY355_-150x150.jpg" alt="" />
        </a><br>
        Title
    </h4>

    The PHP is:

    $imageurl = get_the_post_thumbnail_url(get_the_ID(),'large');
    $title = get_post(get_post_thumbnail_id())->post_title; //The Title					
    echo '<a href="'.$imageurl.'" title="'.$title.'">';
    the_post_thumbnail('thumbnail');
    echo '</a>';

    Thank you for your help!

    [Moderator note — removed <pre> tags and replaced with backticks. ]

    Plugin Author Archetyped

    (@archetyped)

    Hi, I would recommend the following:

    1. Update the loop to save the links to a single variable (i.e. appending each link to the same variable).
    2. Pass the variable containing the links through slb_activate() to activate the links for displaying in a lightbox.
    3. Echo the variable’s content to the page.

    See the Activation page in SLB’s documentation for more details on using slb_activate().

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Using Lightbox images in template’ is closed to new replies.