Modify wp_is_mobile() function to detect Android tablets
-
I have a website that I’m using this code:
<?php if ( !wp_is_mobile() ) { ?> <div id="header-image" style="background-image: url('<?php the_field('header_image'); ?>'); height: 530px; background-position: center <?php the_field('header_background_position'); ?> "> </div> <main role="main"> <?php } else { ?> <main role="main" style="margin-top: 50px"> <?php } ?>
Now this works on hiding the <div id=”header-image”> from mobile phones and iPad/iMinis. But I have an Acer Android tablet and the <div id=”header-image”> does display, when it shouldn’t.
How may I modify the function to include this tablet (and all other types) device?
Thank you.
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Modify wp_is_mobile() function to detect Android tablets’ is closed to new replies.