Title: Postview wont update
Last modified: January 28, 2020

---

# Postview wont update

 *  [iedtwodth](https://wordpress.org/support/users/iedtwodth/)
 * (@iedtwodth)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/postview-wont-update/)
 * Hi,
 * I have this counter for postviews, using ACF and elementor.
 * But it wont count+ Its going back to one all the time?
 *     ```
       function child_theme_head_script() {
       	global $views;
       	if (is_singular('post')) {
       		$views = (int) get_field('views');
       		$views++;
       		update_field('count_view',$views);
       		echo $views;
       	}
       }
       add_action( 'wp_head', 'child_theme_head_script' );
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/postview-wont-update/#post-12374799)
 * you get a field with key ‘views’ and update a field with key ‘count_view’ – is
   that on purpose, and if what is the login behind it?
 *  Thread Starter [iedtwodth](https://wordpress.org/support/users/iedtwodth/)
 * (@iedtwodth)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/postview-wont-update/#post-12374805)
 * thanks … i was blind

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Postview wont update’ is closed to new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 2 replies
 * 2 participants
 * Last reply from: [iedtwodth](https://wordpress.org/support/users/iedtwodth/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/postview-wont-update/#post-12374805)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
