Hey there!
Try adding this to your theme’s functions.php file:
function wpp_ip_exclusion( $post_ID, $views ){
$ip_address = $_SERVER['REMOTE_ADDR'];
$excluded_ip_addresses = array( 'YOUR-IP-ADDRESS-HERE' );
// Visitor has already seen this page
if ( in_array( $ip_address, $excluded_ip_addresses ) ) {
exit();
}
}
add_action( 'wpp_pre_update_views', 'wpp_ip_exclusion', 10, 2 );
Change YOUR-IP-ADDRESS-HERE with your actual IP address.
Worked, thank you.
Another question, ‘trending now’ in dashboard shows most viewed posts of the last 24 hours, right? And ‘most viewed’?
-
This reply was modified 8 years, 8 months ago by
vicetias.
-
This reply was modified 8 years, 8 months ago by
vicetias.
Take a look at WPP v4 release notes, should clear things out.
Please @hcabrera, reply to my question at “How To: Sort a custom query by views”