post_type, array_keys($post_types) ) && !in_array( $_SERVER['REMOTE_ADDR'] , $excluded_ips ) && !in_array($post->ID ,$storedIds) ){ $postCount = get_post_meta( $post->ID, 'post_count_'.$post->ID, true ); if( $login_users == 'yes' && is_user_logged_in() ){ } else { $postCount = !empty($postCount)?$postCount+1:1; $postIds[] = $post->ID; setcookie("epvc_post_views", json_encode($postIds) , time()+3600*24*365*10, '/'); } update_post_meta( $post->ID, 'post_count_'.$post->ID, $postCount ); } } } /** * Post content display * * Display post views * * @package Easy Post Views Count * @since 1.0.0 */ function epvc_display_post_views( $content ){ global $epvc_settings; $position = $epvc_settings['position']; $CountContent = epvc_display_post_views(); if( $position == 'after_content' ){ $postContent = $content.$CountContent; } else if( $position == 'before_content' ) { $postContent = $CountContent.$content; } else { $postContent = $content; } return $postContent; } /** * Post views count style * * Css for post count icon * * @package Easy Post Views Count * @since 1.0.0 */ function epvc_print_style(){ ?> '', ), $atts ) ); ob_start(); echo epvc_display_post_views( $id ); $content .= ob_get_clean(); return $content; } } return new Epvc_public();