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
Share on other sites

I actually feel quite foolish. Upon looking at the source again from the browser I noticed something was wrong with the embed code I was using. Went to youtube and switched it out for another and was able to get it to work in internet explorer.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.