I’m having trouble using the Duplicate Post plugin (http://wordpress.org/plugins/duplicate-post/) alongside ACF (and the repeater field addon): when I duplicate a page the data in the ACF fields appear to have been duplicated successfully but editing any of the content/values has no effect on the duplicated page when viewing it on the front end.
Upon closer examination, the get_field/get_sub_field functions appear to read the ACF data from the original page – not the new, duplicated one.
Note that I am making use of the repeater field addon, however I’m not sure if this is relevant.
My initial searches for a fix brought me to this topic: http://wordpress.org/support/topic/caching-conflict-with-duplicate-post, which seems to describe the same problem.
Any ideas?
Thanks,
Nick
Hi @NickBS
I can guarantee that the issue does not stem form the repeater field.
The issue sounds like a conflict in the global $post object.
In your page template, can you dump out the global $post object. Is the post->ID correct? If not, you will need to do some debugging to find out why, but the problem will not be from ACF, but perhaps from cache such as the other thread decribes
Thanks
E
Thanks Elliot, yes – it was a $post issue.
It appears something else further up in the template had been using a $post variable which just happened to be set to the original page. A global $post and some sensible variable renaming has sorted out the problem.
Thanks for your patience! 🙂