Tagged: functions.php
Hi,
is there a way to determine if we are on a mobile device in functions.php() ?
Background is this:
I added a function to display a phone number in a specific way, like so:
function add_stuff_after_main_menu() {
$is_mobile = True;
if ( is_front_page() || !is_front_page() && $is_mobile ) {
echo '<div style="float:right;">';
echo '<div style="margin-top: -25px;"><a class="phoneicon phonelink" href="tel:+4912345">+49 12345</a></div>';
echo '</div>';
}
}
add_action('ava_after_main_menu', 'add_stuff_after_main_menu');
This works as expected, but for my variable $is_mobile I need a function to get the real functionality.
Is there a way where I can get the needed information?
Thanks in advance,
Michael
Ouch, sorry…I only read the conditional stuff, but missed this one.
Thank you and have a nice weekend.