• Resolved JMR contact

    (@jmr-contact)


    Hi

    First of all, thanks for this so awesome theme ! I like it !

    I wonder whether it is possible to replace picture in the homepage by a video when users visit my site on a desktop and use a picture if they use a mobile device.

    Thanks in advance for your help !

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • Theme Author Tim Nicholson

    (@timnicholson)

    That’s an interesting idea. I’m trying to keep my themes as pure to the out-of-the-box WordPress experience as possible. Currently that means using featured image functionality. It would be great if WordPress let you set a video as featured, like with images. Then it would be easy to display them in the page and article templates.

    What you are wanting to do is probably fairly difficult at this point. I can point you to a few things that might help you think through how best to tackle it. The theme is based on Bootstrap an it does support classes that indicate whether to display on desktop or mobile. See Bootstrap responsive utilities. You would have to embed both the video and the image and use those CSS classes to determine which to display.

    WordPress also has a function wp_is_mobile() that can be used server-side (php). You’d have to edit the page.php and/or single.php template. See wp_is_mobile(). That function returns true for tablets though, not just for mobile phones.

    Then there are additional complexities depending on whether you want text to overlay the video (like the theme does for images), whether you want the video to auto-play or not, etc.

    Thread Starter JMR contact

    (@jmr-contact)

    Hi

    Thank you for your advices. I appreciate your help ??
    I’ll read those links and I’ll try to replace images by videos.
    Yes you’re right i want my texts overlay the videos like for images and the videos will play automatically.
    Maybe, I will have to modify the green color of background , of the icons like search , of the titles, of the social links of the footer .

    Regards

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Put a video instead of a picture in the homepage’ is closed to new replies.