Detect phone / tablet / desktop : Media queries or Server side detection ?

Community Forums Forums General Discussion Detect phone / tablet / desktop : Media queries or Server side detection ?

This topic is: not resolved

This topic contains 3 replies, has 2 voices, and was last updated by  braddalton 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #107222

    Loudness
    Participant
    Post count: 38

    Is there a way to detect if a user is using a tablet, a phone or a desktop ?

    I know I can use media queries, but here’s the problem : some phone now have the same resolution as tablet, but only have half the screen size. (more pixel density). I want a particular notification bar to be shown on the right side on desktop & tablet, but this same bar should be at the bottom on phone since it would take too much space on the side on a phone.

    What would be the best ? Server side detection ? A plugin such as WP Mobile Detect ? I saw a couple article stating media queries were better than server side detection (not sure why), but then I have the problem stated above…. : Some device have the same resolution, but different screen size.

    Any suggestion would be appreciated.

    #107250

    braddalton
    Participant
    Post count: 9415

    You can use mobile conditional tags from a plugin like Mobble or write your own. http://clicknathan.com/web-design/wordpress-mobile-conditional-statement/


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

    #107411

    Loudness
    Participant
    Post count: 38

    is it possible to load a plugin conditionally using the above plugin ? (or Wp mobile detect) ?

    So this way I could install 2 different plugin : 1 for the pull out notification for desktop + tablet & another plugin for the notification bar at the bottom & just load the one required by the user based on the device they use ?

    #107415

    braddalton
    Participant
    Post count: 9415

    I would ask the plugin Developers this question as they are the best people to ask.


    Specializing In StudioPress Child Theme Customization.
    500+ StudioPress Tutorials

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.