Disable map widget for mobile devices

This topic contains 9 replies, has 3 voices, and was last updated by  Adam 9 years, 7 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #17771

    Adam
    Buyer
    Post count: 88

    Hi,

    I dont even know if this belongs here, but i will try to ask it 🙂 –

    Is there a way to disable the map (homepage/listing etc. all of them) widget for mobile devices? At least those with small resolution.

    I know that there is way to hide it from them, but i dont like it this way, because it gets rendered/downloaded by the device even if the user wont see it.

    Is there maybe a plugin for it? Or some simple code would do it?

    Thanks!

    #17783

    Simone
    Expired Member
    Post count: 3515

    Hi Adam,
    to prevent the loading of the map for a specified resolution, I believe you should add some conditions in the code, and that goes deeper than just hiding the divs in the CSS (a thing that you don’t want, as I read 🙂 ).
    I don’t think there are plugins available, and a code would be overridden if a GD update will be released.
    I’ll leave the final thoughts to Stiofan (notified now).

    #17789

    Paolo
    Site Admin
    Post count: 31206

    I think you could use something like mobble plugin.

    https://wordpress.org/plugins/mobble/

    However, you would still have to recreate all map widgets as custom widgets in your child theme functions.php file and include the

    is_mobile()

    condition from mobble to the whole widget function.

    It shouldn’t be that hard.

    Let us know if this points you in the right direction.

    Thx

    #17800

    Adam
    Buyer
    Post count: 88

    Thanks for the tips Simone and Paolo, i will try it if will help me.

    I wanted to try the hide route but huh, i dont know why it doesnt work? It should be easy like this:

    
    
    @media screen and (max-width: 960px) {
    #geodir_map_v3_home_map_1 { display: none; }
    }

    But this doesnt work for me. I would like to hide some simple stuff where it doesnt matter if it gets downloaded or not, but i cant figure it out why it doesnt work. I save it in the childtheme style.css

    #17801

    Paolo
    Site Admin
    Post count: 31206

    link?

    #17802

    Adam
    Buyer
    Post count: 88
    This reply has been marked as private.
    #17805

    Paolo
    Site Admin
    Post count: 31206

    it seems that you picked the wrong selector.

    Try : #sticky_map_geodir_map_v3_home_map_1

    Let us know,

    #17806

    Adam
    Buyer
    Post count: 88

    This works now, many thanks Paolo! 🙂

    #17807

    Paolo
    Site Admin
    Post count: 31206
    This reply has been marked as private.
    #17813

    Adam
    Buyer
    Post count: 88
    This reply has been marked as private.
Viewing 10 posts - 1 through 10 (of 10 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket