How i can update a value of single sub field of repeater of each post. It’s vary urgent…
Hi @nitins
1. Use the get_posts
function to return all the posts you want
2. Loop over the posts
3. For each post, update the value
To update the value, either use a WP function such as update_post_meta
or the ACF function update_field
.
Please note that update_field
will only work to update a repeater field, not a sub field within a repeater.
Saving a repeater field: http://support.advancedcustomfields.com/forums/topic/update_field-with-repeater-fields-issue/
Thanks
E
actually in my project, everytime a post is opened, a single sub-field is displayed based on some logic.. and everytime it is being displayed, a counter in that gets incremented.. In order to increment the counter, I need to update only that particular sub-field, keeping all others same… is this possible?
Thanks in advance
Hi @nitins
Yes, it is possible to update a sub field via the comment I left above.
Your last comment is hard to understand. Perhaps you can elaborate more clearly to what exactly you would like to do step by step
Thanks
E