21st Nov, 2007

The easy way to embed flash into a wordpress blog.

I don’t know if you have ever tried to embed flash into your wordpress blog, for the benefit of those who haven’t - It is a royal pain in the backside!

Anyway, it frustrated me that I couldn’t find a definitive way of doing it, wordpress for some reason doesn’t seem to like the object and embed tags that are used to embed flash in html. Even worse the only solutions I could find were aimed at people looking to embed youtube videos on their wordpress blogs. The Flash Video solutions I found all involved downloading 3 separate plugins and that seemed a tad excessive.

I found a solution to this, cheap and nasty admittedly, but a solution for embedding flash in a wordpress blog all the same.

So now you want to know what it is, eh?

Well in a word: iframes.
I had almost forgotten about my old friends iframes, until this problem reared its ugly head at me, yet they seemed perfect for this application. I will use a youtube video for my example, but any swf will also work:

  1. You will need access to upload an html file to a webserver somewhere - if you host your own wordpress blog you can upload the html file to the same server.
  2. Grab the code from youtube, it is on the right under “about this video” and in a box titled “embed” select it all and copy it.
  3. Open some text editing software eg. Notepad (windows) or textedit (mac) and paste the code into a new file.
  4. Save the file as filename.html (change filename to whatever you want, I use a descriptive name to make it easy to remember).
  5. Upload the html file to your server.
  6. In your wordpress admin go to Write > Write Post.
  7. Write your stunning post.
  8. Decide where in your post you want the youtube (works for Flash too remember!) content to appear.
  9. Click on the html icon above the editor in wordpress and type this at the place you decided:
    <iframe width="425" height="355" frameborder="0" src="http://yourserver.com/filename.html"></iframe>
  10. Save your post and view it in all its glory on your blog!

I hope this helps someone.

Leave a response

Your response:

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Categories