WP Mobile Detect
Functions Code Example (6 posts)

  1. Fla0
    Posted 1 year ago #

    If I'm reading this correctly you can add functions that will automate the mobile detection. Could you please give an example of the functions code to be placed in the themes functions.php file?


  2. JulieMarie
    Posted 1 year ago #

    i too would like an example of how to use wpmd_is_ to block a plugin

  3. Chris
    Posted 1 year ago #

    You have to wrap what you want to hide in a functions snippet. I am not too handy with php but this is what is working for me:

    <?php if (function_exists('wpmd_is_phone') && wpmd_is_phone()) :?>
    This will show if there is a phone
     <?php else : ?>
    This will show if it is anything but a phone
     <?php endif; ?>

    Hope that helps!

  4. RB001
    Posted 1 year ago #

    It did, thanks.

  5. jencardwell
    Posted 1 year ago #

    I have been looking at this plugin for awhile and I just don't know enough to know how to use it. The example above doesn't help. I wish it did.
    I would like to hide the flash banner in my header.php file on all mobile devices. I am not sure how to use the functions and/or short codes to do that.

    Can anyone give me any information that will help? I will post code as needed. I just didn't want to do it needlessly.

    Thanks for any information.

  6. samenezes
    Posted 1 year ago #

    That is it, Chris.

    I had a problem with a bar named wp-SuperSized with small MOBILES screens;
    (resumo em brasileiro / português, ao final).

    Problem: The bar DON'T stay on bottom, anytime, as expected.

    I will exclude mobiles, for now!

    At wp-supersized/index.php -- before the block begining with "include_once(....", do:

    if ( !wpmd_is_device() )
    ******* ORIGINAL BLOCK ******
    ******* OF CODES **************

    So, the NOT "!" include desktop only; Exclude all 'devices' (as example).

    That is all.
    Artur Sá Menezes

    Português, brasileiro:
    Implementação de IF no arquivo wp-supersized/index.php, funciona perfeitamente, EXCLUINDO os mobiles da exibição deste wp-SuperSized, mas somente depois de instalado o plug-in https://wordpress.org/plugins/wp-mobile-detect, vide /faq/ também --- depois, vou ver se incluo os iPads e tablets maiores...

    Fácil de testar, se você tiver o Forefox e mudar o "Browser Agent" para um iPhone, por exemplo. A barra desaparece.

    Só isso

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Mobile Detect
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic


No tags yet.