This question is really specific and for some of you guys maybe really easy to answer. I'm struggling with something for a website for a client already 2 hours.
I will try to explain it as good as possible. I made use of custom fields in Wordpress so that the customer can add images to products. I show the images in a lightbox like this (with plugin lightbox plus): <a rel="lightbox[<?php the_field('actietitel'); ?>]" href="<?php the_field('productafbeelding2'); ?>"> </a>
. But when there is no "productafbeelding2 for example, HTML will still creat that lightbox but it's value is NULL so it keeps loading. I'm now trying to fix it with an 'if-else-statement' which says:
<?php
if(the_field('actie-afbeelding2') != null)
"<a rel='lightbox[" . the_field('actietitel'); "]' href='" . the_field('actie-afbeelding2') . "'> </a>"
?>
But for some reason it won't work (this is my hundreds attempt so sorry if it is really bad this part of code). Actually, it works but it returns the URL and not in the lightbox. But the first piece of code I showed you actually DOES return the link in a lightbox.
You can see it yourself at: http://www.bgc-testomgeving.nl/jorn/ambachtelijk/
Hope you guys can help me!
PS: i'm SO sorry for my grammar, I suck at it.