Not Working with ACF
-
I’m having trouble understanding where to put the code and what parts to customize in order to get this to work with ACF. I have an acf image field named ‘banner’. Here is my code:
Theme File:
<?php $image_object = get_field('banner'); $image_output = '<img src="' . $image_object['sizes']['medium'] . '" title="' . $image_object['title'] . '" alt="' . $image_object['alt'] . '" />'; echo apply_filters('theme_acf_image', $image_output, 'name_of_the_image_field'); ?>
functions.php
function theme_function_for_acf_image($content, $name_of_the_image_field){ return Picturefill_WP::get_instance()->cache_picturefill_output($content, $name_of_the_image_field); }
All that outputs is the letter h. If I echo $image_object it outputs the proper url of the uploaded image. Any input is much appreciated.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Not Working with ACF’ is closed to new replies.