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?

closed as off-topic by Rarst Aug 22 '14 at 20:41

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

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
    that inspired me. the solution was to add the a-tag with the link to the full-image around the chart ... :) – helle May 6 '14 at 16:21

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