I’m looking for a way to get total views for all articles of a certain category, and I used this code:
wpp_get_views($category->term_id);
But it gives a value of 0 ,even though the articles in the category recorded visits
]]>In your second voting plugin, it was enough that I added “ratings_score” to the custom field and it worked, check picture here , but I have no idea how to do it.
]]>Thank you for this great plugin, i installed it one year ago and it used to work perfectly for me with my custom needs until the last plugin update (5.3.1).
I run a custom WP_query on my frontpage returning the most popular custom post types (weekly), using this code : How To: Sorting a custom query by views (All time, monthly, weekly, or daily) in my functions.php
It was working great until last update, but now, the posts displayed are not matching with the most populars anymore.
My query looks like :
$args = array('meta_key' => 'views_weekly', 'orderby' => 'meta_value_num', 'order' => 'DESC', 'posts_per_page' => 15, 'post_type' => 'guide');
$popularPostsQuery = new WP_query( $args );
And the code in functions.php is :
function custom_wpp_update_postviews($postid) {
$accuracy = 30;
if ( function_exists('wpp_get_views') && (mt_rand(0,100) < $accuracy) ) {
update_post_meta(
$postid,
'views_weekly',
wpp_get_views($postid, 'weekly', false)
);
}
}
add_action('wpp_post_update_views', 'custom_wpp_update_postviews');
Do you have any idea about where this recent issue comes from?
Thank you
]]>Thank you for your Free services
I was using this function to show post cunt, but from yesterday, only the number 0 is displayed
<?php if (function_exists(‘wpp_get_views’)) echo wpp_get_views( get_the_ID(), ‘all’ ); ?>
]]>The following script allows to display on the front side only posts less than one year old in display blocks (list)
it has been used for 2 years and I believe it comes from an exchange between us.
Now
When the script is active ….. the “get views” counters of posts older than one year go to zero
when it is inactive … the “views” counters return to the correct position
I therefore leave inactive for the moment while waiting for the solution.
]]>//////////////////////////////////////////////////////////////////////////////
WPP 2019 LIMITE ARTICLE DE MOINS D UN AN
Filters out popular posts that are older than the
specified time.
@ param string $where
@ param array $options
@ return stringfunction wpp_filter_posts_by_age($where, $options){
if ( ! is_admin() ) {
$where .= ‘ AND p.post_date >= DATE_SUB(NOW(), INTERVAL 1 YEAR) ‘;
}return $where;
}
add_filter(‘wpp_query_where’, ‘wpp_filter_posts_by_age’, 10, 2);//////////////////////////////////////////////////////////////////////////////////////
WordPress can’t handle the sorting by itself, I’m assuming because of the formatting of the value containing commas. But I’m not sure how to correct or if its possible.
]]>I am using WP, popular post plugin. And it is working fine. I am just wondering, if I can use the same data to show views of each post on the post in footer?
So e.g If I have 10 post, and popular post is showing top 3 post for me.
However, for each of 10 posts, I want to show “views” count of each post. How is it possible?
]]>