Support

Account

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);