the_header_video_url()WP 4.7.0

Displays header video URL specified in theme Customizer (theme settings).

Displays a link to a local or an external video. Displays nothing if there is no video.

Use get_header_video_url() to get a header video URL for further processing.

You can learn more about video headers here

No Hooks.


null. Nothing.


<?php the_header_video_url(); ?>



#1 Display HTML video tag

Check whether a header video is set to not display an empty video tag:

<?php if( has_header_video() ){ ?>
	<video class="wp-video-shortcode" id="video-298-1" width="600" height="400" preload="metadata" controls="controls">
		<source type="video/mp4" src="<?php the_header_video_url() ?>" />
<?php } ?>


Since 4.7.0 Introduced.

Code of the_header_video_url() WP 6.0

function the_header_video_url() {
	$video = get_header_video_url();

	if ( $video ) {
		echo esc_url( $video );