Tagged: , ,

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
  • #692569

    Hi guys,

    In your documentation you explained how to use video for featured media and how you can display a poster image to be used as featured image for a video. All clear so far.

    At the end of the video, YouTube shows a grid with different video’s. Unfortunately sometimes there are video’s about maritime disasters, which does not really fit my client’s target audience, since he wants to persuade people to join his boat trips :-(

    • Do you happen to know if this is this is a standard YouTube ‘thing’ or maybe coming from my client’s You Tube settings?
    • If it cannot be changed in YouTube settings, is there a way (maybe through function.php?) to show again the poster image also after playing the whole video?

    Please advise.

    Thanks & regards,


    Hey Monique,

    Are you including it as an iframe? if that’s the case, attach &rel=0 at the end of src:
    <iframe width="500" height="281" src="https://www.youtube.com/embed/Kxy_d-brARA?feature=oembed&wmode=opaque&autoplay=1&rel=0" frameborder="0" allowfullscreen="" wmode="opaque" style="display: block;"></iframe>

    Best regards,


    Hi Josue,

    No, I am using your theme options “Featured media” to add external video by URL (see screenshot).




    Please add this in the functions.php file.

    add_action('wp_footer', 'ava_iframe_parameters');
    function ava_iframe_parameters(){
    	function avia_iframe_parameters_mod(container)
    		var iframe 	= $('iframe[src*="youtube.com"]', container),
    			youtubeEmbed = $('iframe[src*="youtube.com"] object, iframe[src*="youtube.com"] embed', container).attr('wmode','opaque');
    				var current = $(this),
    					src 	= current.attr('src');
    					if(src.indexOf('?') !== -1)
    						src += "&autoplay=1&showinfo=1&rel=0";
    					current.attr('src', src);

    Remove browser cache or hard refresh the page.



    Hi Ismael,

    Wow, that is amazing :-)

    One little thing though: with this code the music of the video starts playing automatically without pushing the play button. Is there a way to change this so that the music only starts playing together with the video when a visitor clicks the start button?

    Thanks & regards,


    Hi Monique,

    Try changing autoplay in Ismaels code to 0:

    Change &autoplay=1

    to &autoplay=0



    Great Rikard! Works perfect :-)

    Thanks a lot.

    Please flag this topic as solved. Can I do that myself by the way, or do you always have to do that?

    Bye bye,


    Hi Monique,

    Great, glad you got it working :-)

    I’ll set the topic as solved for you, only moderators can do that.

    Best regards,

Viewing 8 posts - 1 through 8 (of 8 total)

The topic ‘Question about using video for featured media’ is closed to new replies.