WordPress.org

Ready to get started?Download WordPress

Forums

Responsive Lightbox by dFactory
Adding Responsive Lightbox to images pulled from ACF fields (2 posts)

  1. Ben Hutchings
    Member
    Posted 2 months ago #

    Hi, We're using Responsive Lightbox and have 'Image Links' enabled so that all images have Lightbox applied. However when we insert images into Advanced Custom Fields content areas, the rel tag isn't added automatically.

    Is there a way / action / hook to make Responsive Lightbox work on ALL WordPress media images and not just ones that appear in standard Page or Post Content areas.

    Thanks!
    Ben

    https://wordpress.org/plugins/responsive-lightbox/

  2. jplew
    Member
    Posted 2 months ago #

    sorry if I'm missing something, but what's stopping you from adding the "rel" attribute yourself?

    Something like this:

    $image = get_field('my_image');
    <a href='<?php echo $image['url']; ?>' rel="lightbox"><img src="<?php echo $image['sizes']['medium']; ?>" alt="<?php echo $image['alt']; ?>" /></a>

Reply

You must log in to post.

About this Plugin

About this Topic