Support » Plugin: Simple Lightbox » [Plugin: Simple Lightbox] SLB won't work with do_shortcode in theme template

  • Resolved realtech

    (@realtech)


    If I place [gallery link="file" columns="1" size="medium"] in the post edit area it works fine.

    If I place <?php echo do_shortcode('[gallery link="file" order="ASC" columns="1" orderby="menu_order" size="medium"]'); ?> in the single.php file in the theme directory it does not add the ‘rel=’ to the hyperlink os the lightbox does not work.

    I assume the plugin injects the rel= code to the_content() only. Do you have a workaround for this?

    http://wordpress.org/extend/plugins/simple-lightbox/

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

    (@archetyped)

    Instead of using do_shortcode() directly, you can do the following:

    echo apply_filters('the_content', '[gallery...]');

    This will activate SLB for the gallery links and automatically generate the gallery shortcode’s output as well.

    Works perfectly… thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Simple Lightbox] SLB won't work with do_shortcode in theme template’ is closed to new replies.