Function to add Vimeo Shortcode
-
I am displaying videos from Vimeo on my website and in order to make this easier than embedding the code all the time I have created code in the template files that uses a custom field instead. It uses an if statement to check that the custom field is present and then if it is it displays the flash embed code for the vimeo video ID entered as a custom field.
However this only places in where I placed the code in the template file. I want to be able to create a function to go in functions.php where I can then check whether the custom field is present and then if it is, I can then use a short code in my post (something like [vimeo=2322] which will then display the video in that place (in the example it would display the vimeo video with the ID of 2322).
I just wondered if anyone knew of anything that was already done or how I could go about doing this myself.
Thanks in advance.
- The topic ‘Function to add Vimeo Shortcode’ is closed to new replies.