Home › Forums › Pre-purchase Questions › Post Views Counter › Reply To: Post Views Counter
Thanks John, but your code didn’t work for me..
Managed to find something that did work, thought I’d add it here in case anyone else comes looking..
// Get the current value. $count = (int) get_field('counter_field'); // Increase it. $count++; // Update with new value. update_field('counter_field', $count);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
Are you building WordPress sites with ACF and @BeaverBuilder, and wanted to use your ACF Blocks in both the block editor and Beaver Builder?— Advanced Custom Fields (@wp_acf) May 10, 2023
The BB team recently added support for using ACF Blocks in Beaver Builder. Check it out 👇https://t.co/UalEIa5aQi
© 2023 Advanced Custom Fields.