When you want a quick way to determine if a visitor is coming from a mobile or desktop, wp_is_mobile is a useful filter.
The problem is this only detects if the visitor is using a mobile device, generally, which could be a phone or a tablet.
This snippet allows you to exclude iPads/ tablets from the equation.
Simply add it to your functions.php
// EXCLUDE IPAD FROM WP_IS_MOBILE
function pands_exclude_ipad( $is_mobile ) {
if (strpos($_SERVER['HTTP_USER_AGENT'], 'iPad') !== false) {
$is_mobile = false;
}
return $is_mobile ;
}
add_filter( 'wp_is_mobile', 'pands_exclude_ipad' );