• Hello Coders !
    sorry i am not really into PHP, but i’d like to ask for help..
    what should i add in the comment line of the following code, to make an item appear? for example if the user uses mobile, a button id=”btn” will change display style from none to block .. i can do this but only using Js and onclick.. any help ? here’s the code :

    <?php
    if ( wp_is_mobile() ) {
    	/* Display and echo mobile specific stuff here */
    }
    ?>

    in an other way, i don’t want to show the button for desktop users. Thank Ya’ll !

Viewing 2 replies - 1 through 2 (of 2 total)
  • The problem with this implementation is that it consider tablet also as a mobile device. So the design might need to suffer a bit.

    You should realize that this does not detect a mobile phone specifically, as a tablet is considered a mobile device

    -from documentation.

    The best way to implement this is to use Media Queries. Check the below link for a sample script.

    https://stackoverflow.com/questions/21649274/how-to-show-hidden-button-with-css-media-query

    Hi You posted on another thread a few months back and wondered if you could help me with that. Is there a way to send a message to you? Is that allowed? I need help with a header and adding a widget to the right of it when the headers rotate

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Change Display on Mobile Detect’ is closed to new replies.