Hi,
If you are using a child theme, please copy this to your functions.php file. This contains the added &rel=0
to the YT parameters and stops related videos playing for all videos.
if ( ! function_exists( 'sf_get_embed_src' ) ) {
function sf_get_embed_src( $url ) {
if ( strpos( $url, 'youtube' ) ) {
preg_match( '/[\\?\\&]v=([^\\?\\&]+)/', $url, $video_id );
$youtube_params = apply_filters( 'sf_youtube_embed_src_params', '?autoplay=1&rel=0' );
if ( is_ssl() ) {
if ( isset( $video_id[1] ) ) {
return 'https://www.youtube.com/embed/' . $video_id[1] . $youtube_params;
}
} else {
if ( isset( $video_id[1] ) ) {
return 'http://www.youtube.com/embed/' . $video_id[1] . $youtube_params;
}
}
} else {
$url = str_replace( 'https://', 'http://', $url );
$video_id = sf_get_vimeoid( $url );
$vimeo_params = apply_filters( 'sf_vimeo_embed_src_params', '?title=0&byline=0&portrait=0&autoplay=1' );
if ( is_ssl() ) {
if ( $video_id != "" ) {
return 'https://player.vimeo.com/video/' . $video_id . $vimeo_params;
}
} else {
if ( $video_id != "" ) {
return 'http://player.vimeo.com/video/' . $video_id . $vimeo_params;
}
}
}
}
}