This is a very useful snippet to execute something either only on mobile or on desktop. This can be placed in any PHP file. <?php if (wp_is_mobile() ) { ?> DO SOMETHING HERE IF MOBILE <?php } else { ?> DO SOMETHING ELSE <?php } ?>