Skip to content

Instantly share code, notes, and snippets.

@kathrynwp
Created March 29, 2018 19:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kathrynwp/a2d858153f24c20ba3bb8953021a0739 to your computer and use it in GitHub Desktop.
Save kathrynwp/a2d858153f24c20ba3bb8953021a0739 to your computer and use it in GitHub Desktop.
Twenty Seventeen Child - display video on mobile
<?php
/**
* Twenty Seventeen Child Theme functions
*
* @link https://developer.wordpress.org/themes/basics/theme-functions/
*
* @package WordPress
* @subpackage Twenty_Seventeen
* @since 1.0
*/
/*
* Enqueue parent and child theme styles.
*/
function twentyseventeenchild_enqueue_styles() {
$parent_style = 'twentyseventeen-parent-style';
wp_enqueue_style( $parent_style, get_template_directory_uri() . '/style.css' );
}
add_action( 'wp_enqueue_scripts', 'twentyseventeenchild_enqueue_styles' );
/*
* Change the minimum screen size to use the video header
*/
function twentyseventeenchild_video_size( $settings ) {
$settings['minWidth'] = 100;
$settings['minHeight'] = 100;
return $settings;
}
add_filter( 'header_video_settings', 'twentyseventeenchild_video_size' );
@kathrynwp
Copy link
Author

Change the 100 value on lines 25 & 26 if you want to change the minimum width or height at which video is served.

Use this file with https://gist.github.com/kathrynwp/cc72b0679760fecf014df1d173109f14

@thedonsmithy
Copy link

Hi Kathryn,

I really need so help to get this to work. I've tried setting up a child theme for the first time and it is not working properly, If you can give me a step by step of what to do as a beginner that would very very much be appreciated.

David

@smjuber
Copy link

smjuber commented Sep 22, 2020

Is it possible to unmute the header video sound modify 'header_video_settings' filter?

@kathrynwp
Copy link
Author

Is it possible to unmute the header video sound modify 'header_video_settings' filter?

Hi @smjuber - this isn't a support venue, so if you have questions about Twenty Seventeen, please post in the forum:

https://wordpress.org/support/theme/twentyseventeen/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment