Jump to content

[SOLVED] Php and Youtube Embed Code


hbuchel

Recommended Posts

I have a wordpress blog that contains a custom field where the user enters the ID of a youtube video. Then using PHP, I insert that ID into the code to embed the video on the page. It works nicely because I can also use the ID to pull a thumbnail from Youtube for the archives page.  The problem is, the videos don't show up in Internet Explorer; every other browser appears to work fine. This is what my code looks like to display the video:

 

<?php $youtubeid = get_post_meta($post->ID, "youtubeid", true); ?>
		<?php if($youtubeid !== '') { ?>
			<div class="video_style">  		
			<object type="application/x-shockwave-flash" style="width:425px; height:350px;" data="http://www.youtube.com/v/<?php echo $youtubeid; ?>">
				<param name="movie" value="http://www.youtube.com/v/<?php echo "youtubeid"; ?>" />
			</object>
			</div>
		<?php } ?>

 

Does internet explorer just not like you inserting php into the embedding code?

Link to comment
https://forums.phpfreaks.com/topic/171065-solved-php-and-youtube-embed-code/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.