WordPress.org

Forums

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

  1. Ben Hutchings
    Member
    Posted 1 year 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 1 year 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>

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Responsive Lightbox by dFactory
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic