WordPress.org

Ready to get started?Download WordPress

Forums

WP Mobile Detect
Functions Code Example (6 posts)

  1. Fla0
    Member
    Posted 7 months 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?

    http://wordpress.org/plugins/wp-mobile-detect/

  2. JulieMarie
    Member
    Posted 5 months ago #

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

  3. Chris
    Member
    Posted 5 months 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
    Member
    Posted 3 months ago #

    It did, thanks.

  5. jencardwell
    Member
    Posted 3 months 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
    Member
    Posted 2 months 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.

    SOLUTION:
    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
    ==============================
    samenezes.wordpress.com

    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
    :D

Reply

You must log in to post.

About this Plugin

About this Topic

Tags

No tags yet.