The bad news is that WordPress likes to screw around with tags when using the WYSIWYG post editor. That makes it kind of hard to, say, embed a video in one of your posts.
So, let’s say you’d like to embed a video:
You click the HTML tab in the editor, paste your code in, and publish your post. Unfortunately, you end up with something like this:
- Copy all the lines inside the
<script>tags and plop them into a file, which we’ll call
- Put your new
my_video.jsfile into your new
js/directory on your server, so it is accessible on the web like so:
- In your WordPress post, switch to the HTML view and add these lines:
my_video.js file and plop it into your new post. WordPress won’t monkey with the single line
<script...></script> stuff. It might wrap it in
<p></p> tags, but that’s generally no big deal. And caching plugins should be perfectly happy with it.
my_video.js file cannot be found on the server, the user will see the
DIV with the text “Error Loading Video!”
Pretty nifty, eh?