WordPress.org

Ready to get started?Download WordPress

Forums

WP jQuery Lightbox
[resolved] problem with gallery in template (8 posts)

  1. omniafausta
    Member
    Posted 1 year ago #

    Hi,

    I just added your plugin to a site I made. And it works fine for pages where I add a gallery manually
    example: http://www.nellyvanderknaap.nl/over-deukbekers/
    (although the pictures do not always end up nicely centered)

    but I have also added a gallery short-code to a template, and here it does not work at all
    example: http://www.nellyvanderknaap.nl/keramiekcursussen-in-midden-portugal/

    Any ideas?
    Thanks!!

    http://wordpress.org/extend/plugins/wp-jquery-lightbox/

  2. ulfben
    Member
    Plugin Author

    Posted 1 year ago #

    Your template doesn't seem to be running the the_content-filter properly.

    If you don't want to change that, just wrap your template gallery output with a call to jqlb_apply_lightbox($your_content);

  3. omniafausta
    Member
    Posted 1 year ago #

    hi, not sure if I 'don't want to change that', because I am not sure how I should run it properly.
    I have adapted a theme, but I am not what you would call fluent in php or js...

    I will look into this and try to find out more about the_content-filter

    thanks!
    I'll keep you updated.

  4. omniafausta
    Member
    Posted 1 year ago #

    ok, I am totally flabbergasted what to do, sorry...

    I'll ask someone I know with more knowledge than me about php and js what to do.

  5. ulfben
    Member
    Plugin Author

    Posted 1 year ago #

    Cool.

    Yeah. Basically; just make sure your template is implementing the loop properly and running the_post somewhere in there.

  6. omniafausta
    Member
    Posted 1 year ago #

    my single.php does not call the loop. (the single.php file is where I have added the short code)
    It does have the_post in this line:
    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    anyway gonna ask my friend to help me now.

  7. omniafausta
    Member
    Posted 1 year ago #

    ok, fixed it.

    changed

    <div id="auto-gallery" class="gallery"> <?php echo do_shortcode('[gallery link="file" column="1" size="medium"]'); ?></div>

    to
    <div id="auto-gallery" class="gallery"> <?php echo jqlb_apply_lightbox(do_shortcode('[gallery link="file" column="1" size="medium"]')); ?></div>

    thanks!

  8. ulfben
    Member
    Plugin Author

    Posted 1 year ago #

    Thanks for sharing the solution. It seems the do_shortcode-call doesn't run all filters. Or maybe your call to do_shortcode happens before the my filter has been registered.

    I need to look into that.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.