Skip to content

Instantly share code, notes, and snippets.

@aristath
Created August 9, 2013 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aristath/6192642 to your computer and use it in GitHub Desktop.
Save aristath/6192642 to your computer and use it in GitHub Desktop.
if ( !isset( get_post_meta( $post_id, 'wpcf-count', true ) ) || is_null( get_post_meta( $post_id, 'wpcf-count', true ) ) ) {
add_post_meta( $post_id, 'wpcf-count', 1, true );
}
$countnumber = get_post_meta( $post_id, 'wpcf-count', true );
$countnumbernew = ($countnumber + 1);
update_post_meta( $post_id, 'wpcf-count', $countnumbernew );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment