Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

I need a clickable image to lightbox text from an ACF field WordPress

  • SOLVED

I've got a few images loading into a page, and I want them to be clickable, and when clicked, load content (text and images) from an ACF WYSIWYG field in a responsive light box.

I'm currently using the Responsive Lightbox from dFactory, so it would be great to work with that existing lightbox in order to not duplicate stuff, but whatever works.

So, to do a fake demonstration of what I'm trying to do:



<a href="<?php the_field('acf_wysiwyg'); ?>" rel="lightbox"><img src="<?php the_field('acf_image'); ?></a>



Can anyone do this? If it's harder than my posted price, let me know.

Answers (1)

2014-11-05

Arnav Joy answers:

it is working or not?
what is your site url?


Kyler Boudreau comments:

http://www.oilygurus.com is the site. Here's a profile: http://www.oilygurus.com/sandi.

No it's not working, I just gave the above code to demo what I'm trying to do. Finding a light box that loads an iframe or other URL is easy. Finding a solution to loading in content from the database, as in an ACF field, not so much.


Arnav Joy comments:

I think you should use fancybox

http://fancybox.net/howto

and you can then use following

<a id="inline" href="#data"><img src="<?php the_field('acf_image'); ?></a>

<div style="display:none"><div id="data"><?php the_field('acf_wysiwyg'); ?></div></div>


Arnav Joy comments:

there are no. of fancybox plugins are available which you can try

https://www.google.co.in/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=fancybox%20plugin%20wp


Kyler Boudreau comments:

I looked at the link and tried the Easy FancyBox until I saw it doesn't support responsive. Another one in the link hasn't been updated for over 2 years.

I'm after a solid answer that works. Sorry, but I can't Google and search...was trying to cut that part out of the equation.


Arnav Joy comments:

ok I checked the "Responsive Lightbox from dFactory" plugin

and using this plugin you can make it work if you choose "FancyBox" as "Lightbox script" from settings

and then you have to do following:-


<a id="inline" href="#data"><img src="<?php the_field('acf_image'); ?></a>

<div style="display:none"><div id="data"><?php the_field('acf_wysiwyg'); ?></div></div>

Please try that and let me know if that works.


Kyler Boudreau comments:

Arnav,

Bummer... couldn't get this to work. But I'll vote for you to get the payment anyway since you tried to help me out.