Problems with the shortcode of views
-
First of all, thank you for the plugin, excellent implementation and great features, very helpful)))
Need help. To display the counter of post views, I took the shortcode published here, removing the restriction for single entries from it:
function wpp_views_count_func() { if ( function_exists('wpp_get_views') ) { $views_count = wpp_get_views( get_the_ID() ); return ($views_count == 1) ? '1' : $views_count . ''; } return ''; } add_shortcode( 'wpp_views_count', 'wpp_views_count_func' );
I put a counter on the main page, in the archives, and in single entries, and in General everything works correctly. But I noticed that sometimes there are records in which the counter remains equal to 1, although I see more than 1000 views in the statistics. I don’t see any errors in the console.
I will be grateful for any hint. Can you tell me what information I can provide to diagnose the problem?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Problems with the shortcode of views’ is closed to new replies.