0

I wrote a Template which uses custom-fields via WP-MoreFields plugin. And there I add an image. In my template I display that Image like this:

<? echo wp_get_attachment_image( get_post_meta( get_the_ID(), 'afp_analysis_chart' , true), 'large' ); ?>

I also use the nextgen-gallery Plugin and configured it, so all images shell be applied the lightbox-effect.

The problem is, the images displayed on this teplate are not applied. How can I force this behavior?

1 Answer 1

1

I'm not familiar with exactly how nextgen-gallery does it, but typically for lightbox effects you need to add rel="lightbox" to the image tag for it to work. To do that you'd do something like this:

$attr = array(
    'rel'   => "lightbox",
true) )),
);

echo wp_get_attachment_image( get_post_meta( get_the_ID(), 'afp_analysis_chart' , true), 'large', 0, $attr );
1
  • 1
    that inspired me. the solution was to add the a-tag with the link to the full-image around the chart ... :)
    – helle
    Commented May 6, 2014 at 16:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.