Skip to content

Instantly share code, notes, and snippets.

@danielpataki danielpataki/Buttons.html
Last active Mar 20, 2017

Embed
What would you like to do?
Customizing Video Headers
add_theme_support( 'custom-header', array(
'video' => true
));
<button type="button" id="wp-custom-header-video-button" class="wp-custom-header-video-button wp-custom-header-video-play">Pause</button>
<button type="button" id="wp-custom-header-video-button" class="wp-custom-header-video-button wp-custom-header-video-pause">Play</button>
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;
}
add_filter( 'header_video_settings', 'my_header_video_settings');
function my_header_video_settings( $settings ) {
$settings['minWidth'] = 680;
$settings['minHeight'] = 400;
return $settings;
}
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;
}
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
You can’t perform that action at this time.