Title: Code provided not working for ACF fields
Last modified: September 1, 2016

---

# Code provided not working for ACF fields

 *  Resolved [yst14](https://wordpress.org/support/users/yst14/)
 * (@yst14)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/code-provided-not-working-for-acf-fields/)
 * Hi,
 * I have a WYSIWYG field within ACF and I am using the WP Media to show images.
   I undertsand that there is some custom code that is needed to make this work 
   on template pages. I found this via previous tickets however I cannot seem to
   get this to work.
 * The code I have is:
 *     ```
       $figures = the_field('lesson_figures');
       if ( function_exists('slb_activate') ) {
           $figures = slb_activate($figures);
   
       }
       echo $figures;
       ```
   
 * I’m not sure what i have done wrong? The code does output the custom field so
   i can see the images on my page however when I click on the image it just links
   to the media file?
 * Thanks
    Ben
 * [https://wordpress.org/plugins/simple-lightbox/](https://wordpress.org/plugins/simple-lightbox/)

Viewing 1 replies (of 1 total)

 *  Thread Starter [yst14](https://wordpress.org/support/users/yst14/)
 * (@yst14)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/code-provided-not-working-for-acf-fields/#post-7510320)
 * [SOLVED]
 * Needed to use `get_field` instead of `the_field`

Viewing 1 replies (of 1 total)

The topic ‘Code provided not working for ACF fields’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/simple-lightbox.svg)
 * [Simple Lightbox](https://wordpress.org/plugins/simple-lightbox/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-lightbox/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-lightbox/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-lightbox/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-lightbox/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-lightbox/reviews/)

 * 1 reply
 * 1 participant
 * Last reply from: [yst14](https://wordpress.org/support/users/yst14/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/code-provided-not-working-for-acf-fields/#post-7510320)
 * Status: resolved