Wordpress

WP Post Views Count without plugin

Today i am going to share how to add post views counting system on wordpress without any plugin. First, copy this code of php function to yours THEME functions.php file. Basically /wp-content/themes/YOUR-THEME/functions.php <? function getPostViews($postID){ $count_key = ‘post_views_count’; $count = get_post_meta($postID, $count_key, true); if($count==”){ delete_post_meta($postID, $count_key); add_post_meta($postID, $count_key, ‘0’); return “0”; } return $count; }…