Wordpress Tips

WordPress Tips: Show post views in the background

As well as utilizing Google Analytics to count the traffic of the entire blog, we will likewise count the quantity of snaps on each article, through the insights of each article, so I can realize which articles are famous with perusers, and can accomplish the blog article traffic Top 10 and different capacities, extremely advantageous and incredible. However, PostViews this module is a bit terrible isn’t behind the scenes of the article list page to show the quantity of hits, check the WordPress Hook, through the accompanying code to accomplish this capacity.

add_filter('manage_posts_columns', function($columns){
	$columns['views']	= __('Views');
	return $columns;
});

add_action('manage_posts_custom_column',function($column_name,$id){
	if ($column_name != 'views'){
		return;
	}
	echo get_post_meta($id, "views",true);
},10,2);

You simply need to duplicate the above code into the first document of your PostViews module or the topic’s function.php. The final product permits you to see the quantity of hits per post on the WordPress backend post rundown page.

Leave a Reply