Hi @victorrest,
This should work:
<?php
if ( function_exists('wpp_get_views') ) {
echo WordPressPopularPosts\Helper::prettify_number(wpp_get_views(get_the_ID(), 'all', false));
}
?>
Thank you so much Héctor, it’s work fine! 🙂
I would be glad if the counter only display at the posts if the current post view is more than 1000, may have any solution for this?
Best regards
-
This reply was modified 2 years, 7 months ago by victorrest.
Thank you so much Héctor, it’s work fine!
Don’t mention it 🙂
I would be glad if the counter only display at the posts if the current post view is more than 1000, may have any solution for this?
Yep, try this:
<?php
if ( function_exists('wpp_get_views') ) {
// Get pageviews count
$pageviews = wpp_get_views(get_the_ID(), 'all', false);
// Post has more than 1000 views, display views count
if ( $pageviews >= 1000 )
echo WordPressPopularPosts\Helper::prettify_number($pageviews);
}
?>
Work like a charm, thank you so much. 🙂
How can i show 1.000 instead of 1k on wordpresspopular posts top 10 widget?
-
This reply was modified 2 years, 5 months ago by incitmemeli.