CSS-Tricks is brought to you in part by Media Temple, the web hosting that we both use and recommend.
I’m trying to get the value from a custom field I have set up and insert that into NGG to pull the correct gallery.
Here is what I’m using:
< ?php $get_short_code = "[nggallery id=" . the_field('image_gallery') . "]";
echo do_shortcode($get_short_code); ?>
The result of that output is “19[Gallery Not Found]”.
19 is the correct value just doesn’t want to work dynamically with the field…. Is there some kind of trick with do_shortcode + ACF fields?
Any help would be greatly appreciated as I’m very much a failure at PHP currently.
You must be logged in to reply to this topic.
Search for Stuff
Browse the Archives
Get the Newsletter
... or get the RSS feed