• Hello,

    Is their a way which i can show part of a post (A Video embed) to users coming from a mobile only?

    Thanks!

Viewing 6 replies - 1 through 6 (of 6 total)
  • you need a separate theme from mobile visits

    Thread Starter log0008

    (@log0008)

    Yes, but how can i change what it shows?

    well the theme should have the code what it would show then you can use js to redirect to that theme if the visit from mobile. its kind of completely another site in terms of coding.

    Or you can use CSS media queries to assign different stylesheets depending on browser window size.
    One of the interresting articles about media queries.

    Thread Starter log0008

    (@log0008)

    That not what i am looking for,

    I was wondering if there was a way to have part of one of my WordPress posts only show up if view from a mobile device

    I need a way of using this code in my post or similar

    include ‘Mobile_Detect.php’;
    $detect = new Mobile_Detect();

    // Check for any mobile device.
    if ($detect->isMobile())
    // mobile content
    else
    // other content for desktops

    This uses the https://mobiledetect.net/ code

    this bit requires a bit knowledge about the theme you are using. go to the them template file (.php) of the page you want different content or insert the above code on. you may ask which page to change on the theme support. for eg: if you want different content to show on home page and the home page template is home.php then you need to edit home.php to insert and modify the query as you want. or you may replicate your theme template file and create your own template(provided your theme supports template). whichever easier for you..

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Only Show Content to mobile users’ is closed to new replies.