This topic has 5 replies, 2 voices, and was last updated 8 years by Radu.

  • Author
  • #127985
     edgy2016
    Participant

    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.

    #128016
     Radu
    Moderator

    Hi, 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 solution
    #128040
     edgy2016
    Participant

    not exactly, im using the portfolio element from visual composer http://seventhqueen.com/themes/kleo/portfolio-full-width/

    #128091
     Radu
    Moderator

    Hi,

    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 solution
    #128124
     edgy2016
    Participant

    Thanks works great

    #128139
     Radu
    Moderator

    No 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
Viewing 6 posts - 1 through 6 (of 6 total)

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?