Skip to content

Instantly share code, notes, and snippets.

@gatespace
Last active December 8, 2016 05:53
Show Gist options
  • Save gatespace/0b8000e13072d828f51b8293afa50cbb to your computer and use it in GitHub Desktop.
Save gatespace/0b8000e13072d828f51b8293afa50cbb to your computer and use it in GitHub Desktop.
WordPress テーマカスタマイザーで動画を追加して出力(ver 4.7以降の場合) ref: http://qiita.com/gatespace/items/760533f0c90095cc6571
<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>
<?php the_custom_header_markup(); ?>
<?php
function themename_custom_header_setup() {
$args = array(
'default-image' => get_template_directory_uri() . 'img/default-image.jpg',
'default-text-color' => '000',
'width' => 1000,
'height' => 250,
'flex-width' => true,
'flex-height' => true,
'video' => true,
)
add_theme_support( 'custom-header', $args );
}
add_action( 'after_setup_theme', 'themename_custom_header_setup' );
.wp-custom-header iframe,
.wp-custom-header img,
.wp-custom-header video {
display: block;
height: auto;
max-width: 100%;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment