Hello. I want to take custom fields from single post. For example, I take the post like ‘$my_post = get_post(22);’ However I don’t take him in a loop and I have no able to use construction like get_field(‘my_field_name’); It doesn’t work for single post.
How this situation can be solved?
If you want to get fields from a post with the ID of 22 then you need to do something like
$value = get_field('my_field_name', 22);
For more information see the section on Get Value from a Specific Post on this page http://www.advancedcustomfields.com/resources/get_field/