• Resolved Tobi_w

    (@tobi_w)


    Hello,
    I am using the code <?php echo do_shortcode( ‘[gallery columns="4"]‘ ); ?> to add a gallery to a custom post type.
    When clicking on the images it opens the media page – not a lightbox. I’d like to show those images in a lightbox and I have the feeling SLB has all that is needed for this but can’t figure out how.
    Can you let me know how to run the “[gallery]” shortcode via php through SLB so SLB works its magic?
    Thank you!
    Tobias

    https://www.ads-software.com/plugins/simple-lightbox/

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter Tobi_w

    (@tobi_w)

    Hi,
    figured it out – of course 2 minutes after posting LOL
    Here is the solution:

    <?php
    $content = do_shortcode('[gallery columns="4"]');
    if ( function_exists('slb_activate') )
    $content = slb_activate($content);
    echo $content;
    ?>

    Had to get rid of the “echo” that is usually used for do_shortcode and it’s working great.
    Thank you for this awesome plugin!
    Tobias

    Plugin Author Archetyped

    (@archetyped)

    Great job! That’s the right way to do it ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘do_shortcode ('[gallery]') with SLB?’ is closed to new replies.