I have a WordPress site that has custom posts and I am trying to output the metadata in a feed. The feed will be a json object but the problem that i am having is that for one of the fields for an image url has the value "field_53ecfb598628f". I have no idea what this is or how to get to the url for the image.
To get the value i am using the following code:
$terms = get_the_terms($post->ID, '_photos_0_photo');
if( !empty($terms) )
{
$term = array_pop($terms);
$custom_field = get_field('_photos_0_photo', $term );
$test = $custom_field;
}
and $test would be set to "field_53ecfb598628f". How do I find my URL from this value?
I'm quite sure by this structure you are using Advanced Custom Fields for this custom meta fields. Therefor you should not use get_field("_photos_0_photo") but guessing by the field name get_field("photos").
By the name I'm guessing its the gallery or repeater field, so you should probably loop trough that, because it will return an array.
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments