• Hi,
    I’m using an ajax method to fetch the post without visiting it’s link, and while doing this, the post counter doesn’t work after the ajax event. I was wondering, is there a manual way to add to the counter while fetching data? For example something like this :

    wp_postview_add_counter($post_ID)

    thanks for supporting this plugin.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Lester Chan

    (@gamerz)

    Sorry nope, there is no such function. It is using post meta

    
    $post_views = get_post_meta( $post->ID, 'views', true );
    update_post_meta( $id, 'views', ( $post_views + 1 ) );
    
    Thread Starter Jack Johansson

    (@mhmdshv)

    Thanks, the code you provided solved my issue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘How to manually add to count?’ is closed to new replies.