[Resolved] Dont display GP Hooks on mobile phone

Home Forums Support [Resolved] Dont display GP Hooks on mobile phone

Home Forums Support Dont display GP Hooks on mobile phone

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #110784
    Philippe

    Is it possible to hide the php code displayed by GP Hooks for Mobile Display ?

    #110840
    Tom
    Lead Developer
    Lead Developer

    Wrap anything you want to hide on mobile devices in a div with the class: hide-on-mobile

    For example:

    <div class="hide-on-mobile">
          I won't show up on mobile
    </div>
    #110855
    Philippe

    I do not arive to operate it ?

    This is the code that I would like to hide on mobile :

    <?php if ( ! is_page( 3161 ) ) : ?>
    <img src="http://www.maggeek.com/wp-content/uploads/2015/05/Barre-grise1.png">
    <?php endif; ?>

    Thank you in advance

    #110965
    Tom
    Lead Developer
    Lead Developer

    Then you would do this:

    <?php if ( ! is_page( 3161 ) ) : ?>
          <div class="hide-on-mobile">
                <img src="http://www.maggeek.com/wp-content/uploads/2015/05/Barre-grise1.png" />
          </div>
    <?php endif; ?>
    #110974
    Philippe

    Excellent thank so much.

    Good day to you 🙂

    #111007
    Tom
    Lead Developer
    Lead Developer

    You’re welcome! You too 🙂

    #277131
    kieferntanne

    Hi Tom,
    please help me…

    How can I disable this code on mobile devices?

    <?php 
        echo do_shortcode("[metaslider id=132]"); 
    ?>

    The code is in the wp_head (hook).
    It is the slider at the top of the page.
    Link

    thx
    Christian

    #277177
    Tom
    Lead Developer
    Lead Developer

    Try wrapping it in the hide-on-mobile class:

    <div class="hide-on-mobile">
        Stuff in here is hidden on mobile
    </div>
    #277420
    kieferntanne

    Hi Tom,

    I think I’ve understood it, but its a shortcode or php.
    I can´t put it into a

    – right?

    #277426
    kieferntanne

    I Can´t put it into a <div> -right …

    #277604
    Tom
    Lead Developer
    Lead Developer

    You can put anything into a div, even shortcodes or PHP.

    Let me know if that doesn’t work 🙂

    #277705
    kieferntanne

    Hi Tom,
    many thanks for your great support.
    The plugin cache enabler was the problem – and I 🙁

    Thank you

    #277785
    Tom
    Lead Developer
    Lead Developer

    You’re welcome 🙂

Viewing 13 posts - 1 through 13 (of 13 total)
  • You must be logged in to reply to this topic.