• Resolved raoulunger

    (@raoulunger)


    Hi
    When activated, the lightbox now works on all images on a site, withou exception. Is there a way to switch it off for certain images, of for a specific page? Or, alternatively only apply the Lightbox on images that carry a certain class or id?

    A possible answer may be in this phrase I found in the questions for developers:
    Apply lightbox to any content by running jqlb_apply_lightbox($your_content, "any ID"); It returns a string with all image links lightboxed, grouped by "any id".

    But I’m not sure how to apply that. I know how to run a script, but I’m not sure how the content should be referred to where it says ‘$your_content’.

    Cheers!

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

    (@firelightwp)

    The code you reference above is for filtering post content. So you’d write a PHP function with that jqlb_apply_lightbox() method within the function, and then you’d hook that onto a WordPress filter. When you use a WordPress filter, that filter will pass the content being filtered to your function. You’d replace $your_content with that variable. If you need more details on that, let me know.

    On your broader question about how to not have an image open in the Lightbox, a few notes:

    The lightbox will only apply to image LINKS. So you can add an image that is not wrapped in an ‘a’ tag, and that will not open in the lightbox.

    For images that are also links, one way to avoid it opening in a lightbox is to add a ‘rel’ attribute to the link, and set that equal to anything other than ‘lightbox’. For example, something like this should not open in a lightbox:

    <a href="YOURLINK" rel="nolightbox"><img src="YOURIMGURL" /></a>

    How you add that rel attribute can vary greatly on how you are adding your content.

    Would an approach like that work for you?

    Thread Starter raoulunger

    (@raoulunger)

    Thanks for the very prompt reply – both options (no link tags, or alternative ‘rel’) work fine.

    And my apologies, I read through the information last night on the plugin’s WP-page, but I overlooked the ‘docs’ button there (it was late…). I just found out that both answers (and some more) were already there on your website!
    Cheers!

    Plugin Author FirelightWP

    (@firelightwp)

    Great, glad those worked!

    And on our docs, I understand. They definitely need both more detail and better organization.

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.