How To Replace Front Page 1 Image With Video In Altitude Pro 1.4 & 1.5

The code in this download folder enables you to add a MP4 video behind the front page 1 widget area in the Altitude Pro child theme for Genesis. No plugins required.

The code adds a video upload setting to the customizer ( as seen in the following demo video ) so you can upload or add a video to the front page one widget area in replace of the static image background. If none added, the default background image will be shown.

Demo Video

The demo shows a video added via the customizer replacing the default static background image behind the front page 1 widget area. Shows a transparent site header background changing to a dark color on scroll and when the mobile menu kicks in.

Tested using versions 1.4 and 1.5 of the Altitude Pro child theme for Genesis by StudioPress using a MP4 video file. Not tested using other video file types.

Installation Steps

  1. # Upload the file named front-page.php to your Altitude Pro child theme folder replacing the default front page template.
  2.  

  3. # Copy & paste the PHP code ( without the opening PHP tag ) to the end of your Altitude Pro themes functions file.
  4.  

  5. # Copy & paste the CSS from the style.css file to the end of your AP themes style sheet and clear caching.
  6.  

Note : Assumes the use of the following HTML in a text widget in the front page 1 widget area. Also assumes the use of the header menu location. CSS for media queries may need modification when using HTML other than the default.

Download Folder

# Change Video To Image On Smaller Screens

If you’re using a lot of custom HTML/Text in a widget displayed over your video on desktops, it’s not going to fit in on mobiles because the video height scales down very small, unlike the background image.

In this case, you can use the following front-page.php file template in replace of the one included in the above download folder and add some additional CSS to the end of your Altitude Pro themes style sheet to swap out the video to a image on mobile sized screens.

Download Folder 2

# Hide Some Widget Text On Mobiles Using CSS

Another option is to use CSS with media queries to hider some of your widget content displaying over your video on smaller screens without swapping out your video with a image :

Example :

@media only screen and (max-width: 600px) {

.front-page-1 .widget p {
 display: none;
}

}

This CSS will hide any text/HTML you have added to the front page 1 widget area which is wrapped in p tags.

# Mobile Testing

The solution in this download folder has been tested on a live domain using my own personal Samsung Galaxy mobile phone as seen in the above video. It’s also been tested using Chrome Inspector as seen in this demo video

# Auto Playing Videos On iPhone’s

Videos may not auto-play on iPhones because of your phone settings which disable videos auto playing in order to block annoying video advertisements with loud music. You can re-enable auto playing of videos using your iPhone settings.


Comments

2 responses to “How To Replace Front Page 1 Image With Video In Altitude Pro 1.4 & 1.5”

  1. Michael Haley Avatar
    Michael Haley

    How am I able to call in the video from Vimeo url?

    1. Hello Michael

      This code only works with a self hosted video file.

      If you want to use a Vimeo hosted file, you can request a custom tutorial.

Leave a Reply

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.