Custom WP_query
-
Hi guys,
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
The page I need help with: [log in to see the link]
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Custom WP_query’ is closed to new replies.