How to control Post view count incresing in sidebar widget posts too?

On a few separate notes:

  • I think your elseif check is probably intended to be elseif( empty( $count ) ), as currently it would result in the count being reset to 0 whenever WP_CACHE is set and the post has a 'tie_views' field – though I may be misinterpreting your intentions.
  • One call to update meta-data is faster than two to delete it then add it again.
  • number_format() produces a string often containing non-numerical characters. Incrementing such a string or casting it to an integer will produce all sorts of unexpected behaviors (i.e. (int)'5,000' produces 5). Format the number only after you’ve performed all relevant mathematical operations.
  • $postID is never defined, nor is it a global variable. Use get_the_ID() to get the ID of the current post within The Loop.
  • The use of @ to suppress errors is typically discouraged, and is often indicative poor practices (warnings and errors should be corrected or handled, not ignored). In this case, we can eliminate it by falling back to a default integer 0 instead of attempting to number_format() null.

All of that said, you can achieve your desired affect by creating a boolean $update argument for your function. This way you can explicitly force your function to update the count (or not to) by calling tie_views( true ) or tie_views( false ).

Going one step further, you can give your function the logic to determine whether or not it should update the count on it’s own in the case that the $update argument was not specified.

function tie_views( $update = null ){
  $count_key  = 'tie_views';
  $post_id    = get_the_ID();
  $count      = get_post_meta( $post_id, $count_key, true );

  // If no 'tie_views' meta-data exists for this post, then the count is 0
  if( empty( $count ) )
    $count = 0;

  // If $update was not set, set it to 'true' if in the main loop and displaying one post.
  if( null === $update )
    $update = in_the_loop() && is_singular();      

  // If the count should be updated and advanced caching is disabled,
  //   increment the count and save it's new value.
  if( $update && ( !defined( 'WP_CACHE' ) || !WP_CACHE ) )
    update_post_meta( $post_id, $count_key, ++$count );

  // Return markup with a formatted count-string
  return '<div class="post-view"><span>' . number_format( $count ) . '</span> ' . __( 'Views' , 'tie' ) . '</div>';
}