Well, Jonathan… I’m impressed with your to-the-point ‘elaboration’
I’ll wait for you to comment first before EVER reacting again in this thread :’)
@boriskamp1991.
1. _thumbnail_id
is the ID WordPress uses for the attached image term.
2. If you are seeing an object then you asked for an object. See the info on get_fields() vs the_field() on http://www.advancedcustomfields.com/resources/
@Jonathan
Yes, that works fine and is a better approach I think. I’m rather new to wp-development: didn’t even know that function is there 🙂
I had some issues with the code from Jonathan in the case a post already has a thumbnail. (E.g: after modifying the contents of the custom image field)
The solution that works for me is to put the line:
delete_post_thumbnail( $post_id);
before the line
add_post_meta($post_id, '_thumbnail_id', $value);
Hi Asger22,
On the frontend form show the image field you already created in a field group.
In the example code above given by Jonathan change the ‘cursusfoto’ substring to the fieldname of your image field.
That should do it.