• Hi,

    I’m trying to hide the top bar of an embedded you tube video but the following is not working:

    [embed width="690px"]https://www.youtube.com/watch?v=ikHxIHZEqBw&showinfo=0[/embed]

    I’m using &showinfo=0 but it’s not having any effect.

Viewing 8 replies - 1 through 8 (of 8 total)
  • Remember, you should always post a link so we can examine your code. This tag does not look like typical embed code for YouTube.

    Try using this format:
    <iframe src="https://www.youtube.com/embed/4qoam6DqVG4?hd=1&rel=0&autohide=1&showinfo=0" frameborder="0" width="500" height="280"></iframe>

    Thread Starter ralphonz

    (@ralphonz)

    Sorry, but thats not right. I don’t want my client to have to use HTML.

    I’m following the instructions described in the codex: https://codex.www.ads-software.com/Embeds

    Says nothing about iFrames.

    Says nothing about hiding the top bar either that I can see.

    If you do not want your visitors to see the top bar and you can’t educate your client, I guess you are going to need to write some code. ??

    Thread Starter ralphonz

    (@ralphonz)

    Hi,

    Yes quite right, it says nothing about hiding the top bar. However youtube does mention adding &showinfo=0 to the url to hide the top bar but it doesn’t seem to be working…

    ralphonz,

    What you are using is a shortcode. I have provided you with the correct format above. If you are intent on using shortcodes and yet still want this effect achieved, you are gong to have to code this functionality into your theme. Unless you can find a theme or a plugin that already has this possibility. Perhaps someone will chime in with such a suggestion, but I have searched briefly for it and could not find anything.

    You see, in order to use a shortcode, someone has to write PHP code to make it work. You can see for example at WordPress.com they do have this feature, because they have code that parses this string and looks for the showinfo flag.

    Thread Starter ralphonz

    (@ralphonz)

    Hi totaltec,

    Thanks for your suggestion. I know how to write short codes into a theme so may have to take that route. Just thought it was worth posting on here first to see if I was missing something. Seems odd that the existing embed short code doesn’t include this sort of functionality!

    My experience with non-technichal clients has shown me that they freak out if they have to deal with HTML so I was looking for a more user friendly way.

    WordPress 4 made such a big deal out of embedding video and audio easily into the WYSIWYG editor that I assumed this sort of thing would be easy!

    Thanks for your help. Always appreciated.

    Thread Starter ralphonz

    (@ralphonz)

    How about this little gem:

    // customize embed settings
    function custom_youtube_settings($code){
    	if(strpos($code, 'youtu.be') !== false || strpos($code, 'youtube.com') !== false){
    		$return = preg_replace("@src=(['\"])?([^'\">\s]*)@", "src=$1$2&showinfo=0&rel=0&autohide=1", $code);
    		return $return;
    	}
    	return $code;
    }
    
    add_filter('embed_handler_html', 'custom_youtube_settings');
    add_filter('embed_oembed_html', 'custom_youtube_settings');

    found at:
    https://tutorialshares.com/youtube-oembed-urls-remove-showinfo/

    Stick it in your functions.php ??

    You rock ralphonz! Glad you found it.

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Hiding youtube top info bar’ is closed to new replies.