Last active
March 20, 2017 17:29
-
-
Save danielpataki/64f7102bc27871f105161ff8f6d5ff29 to your computer and use it in GitHub Desktop.
Customizing Video Headers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_theme_support( 'custom-header', array( | |
'video' => true | |
)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_theme_support( 'custom-header', array( | |
'video' => true, | |
'video-active-callback' => 'custom_video_active_callback' | |
)); | |
function custom_video_active_callback() { | |
if( !is_user_logged_in() && !is_home() ) { | |
return true; | |
} | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'header_video_settings', 'my_header_video_settings'); | |
function my_header_video_settings( $settings ) { | |
$settings['minWidth'] = 680; | |
$settings['minHeight'] = 400; | |
return $settings; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'is_header_video_active', 'custom_video_header_pages' ); | |
function custom_video_header_pages( $active ) { | |
if( is_home() || is_page() ) { | |
return true; | |
} | |
return false; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'header_video_settings', 'my_header_video_settings'); | |
function my_header_video_settings( $settings ) { | |
$settings['l10n'] = array( | |
'pause' => __( 'Pause It' ), | |
'play' => __( 'Play It' ), | |
'pauseSpeak' => __( 'Video stopped.'), | |
'playSpeak' => __( 'Video started.'), | |
); | |
return $settings; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment