PHP mixed with html mixed with wordpress tags gets wrong output -
this question specific , of guys maybe easy answer. i'm struggling website client 2 hours. try explain possible. made use of custom fields in wordpress customer can add images products. show images in lightbox (with plugin lightbox plus): <a rel="lightbox[<?php the_field('actietitel'); ?>]" href="<?php the_field('productafbeelding2'); ?>"> </a> . when there no "productafbeelding2 example, html still creat lightbox it's value null keeps loading. i'm trying fix 'if-else-statement' says:
<?php if(the_field('actie-afbeelding2') != null) "<a rel='lightbox[" . the_field('actietitel'); "]' href='" . the_field('actie-afbeelding2') . "'> </a>" ?> but reason won't work (this hundreds attempt sorry if bad part of code). actually, works returns url , not in lightbox. first piece of code showed return link in lightbox.
you can see at: http://www.bgc-testomgeving.nl/jorn/ambachtelijk/
hope guys can me!
ps: i'm sorry grammar, suck @ it.
use code
<?php if(isset(get_field('actie-afbeelding2') && get_field('actie-afbeelding2')!= "") { echo "<a rel='lightbox["; the_field('actietitel'); echo "]' href='"; the_field('actie-afbeelding2'); echo "'> </a>"; } ?>
Comments
Post a Comment