-
Author
Tagged: disable related videos youtube
-
July 4, 2016 at 19:32 #127985edgy2016Participant
Hello, need to prevent the related youtube videos at the end of the youtube embed video player.
But cannot find the way of modify the theme in order the iframe of the oembed function of wordpress so the youtube url get saved in the data base with the &rel=0 attribute.
July 4, 2016 at 21:59 #128016RaduModeratorHi, to be sure,
You are referring to the youtube embed played element from visual composer right ?
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJuly 5, 2016 at 03:04 #128040edgy2016Participantnot exactly, im using the portfolio element from visual composer http://seventhqueen.com/themes/kleo/portfolio-full-width/
July 5, 2016 at 17:43 #128091RaduModeratorHi,
add this script to wp-admin -> theme options -> general settings -> JavaScript Code
COPY CODE<script> jQuery( document ).ready(function() { /* remove embed video titles */ if (jQuery(".porto-video").length) { jQuery('iframe').each(function() { var video = jQuery(this); var vidSrc = ""; vidSrc = video.attr('src'); if(vidSrc.indexOf("//www.youtube.com/embed/") > -1){ video.attr('src', vidSrc + '&autohide=1&rel=0'); } if(vidSrc.indexOf("//player.vimeo.com/") > -1) { if(vidSrc.indexOf("?") > -1) { video.attr('src', vidSrc + '&title=0&byline=0&portrait=0'); } else { video.attr('src', vidSrc + '?title=0&byline=0&portrait=0'); } } }); } }); </script>
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Ticket solutionJuly 5, 2016 at 20:25 #128139RaduModeratorNo problem
Have a nice week
Cheers
R.Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
Viewing 6 posts - 1 through 6 (of 6 total)
The forum ‘General questions’ is closed to new topics and replies.