Hello I have been trying to add videos to my wordpress and found a post by an individual that stated that by adding a function to the function.php and installing a plugin that I would be able to add a video, Would this work? If so where would I add the function in function.php I tried to add it but just caused it to have errors as im not experienced in php. Please assist me in this.
Below is the post made by an individual on how to do this
"I do this to embed videos in my blog posts:
Note: You'll need the More Fields plugin or similar (http://labs.dagensskiva.com/plugins/more-fields/)
1. In functions.php in my theme folder I've added this function:
function get_video() {
$video_url = get_meta('video'); // get_meta is the hook from the More Fields plugin
echo "<div id='post-";
echo the_ID();
echo "'>Get the Flash Player to see this player.</div>
<script type='text/javascript'>
var so = new SWFObject('player.swf','mpl','720','424','8');
[...other variables here...]
so.addVariable('file','$video_url');
so.write('post-";
echo the_ID();
echo "');
</script>";
Now, I'm not a decent php monkey so this could probably prettier, but hopefully you'll get the idea...
2. Add <? get_video(); ?> in the template files for your posts where you want the video to appear.
3. When I write a post I add a custom field "video" with the URL to the video file as value."