[Support request] GP Hooks – disable on mobile and tablet?

Home Forums Support [Support request] GP Hooks – disable on mobile and tablet?

Home Forums Support GP Hooks – disable on mobile and tablet?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #473722
    Craig

    Did a search, can’t find anything on this, sorry if I missed a solution.

    I have a slider sitting in my wp_head, is there a way to disable from showing on smartphone and tablet, via css?

    Thanks, the hooks are a fantastic feature. thank you.

    Craig

    #473734
    David
    Staff
    Customer Support

    You can use media queries with CSS to hide the slider. You will need to know the sliders #ID or a one of its parent CSS Classes. And then add this CSS to the additional CSS in your customiser:

    @media (max-width: 1024px) {
        .my-slider-class {
            display: none;
        }
    }

    I would advise that you don’t put your slider in the wp_head, this is reserved from meta data, styles and scripts. Use the Before Header instead.

    #473739
    Leo
    Staff
    Customer Support

    Another way would be to wrap your slider shortcode in a div with the built in hide-on classes.

    See second example here: https://docs.generatepress.com/article/responsive-display/#using-our-hide-on-classes

    And yes definitely Not in wp_head 🙂 Thanks David!

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