Forums

Function to add Vimeo Shortcode (7 posts)

  1. equaldesign
    Member
    Posted 3 years ago #

    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.

  2. equaldesign
    Member
    Posted 3 years ago #

    I have found a vimeo plugin in the plugins directory but it is still a little more complicated than I was hoping for. Any ideas anyone?

  3. SpY MaN
    Member
    Posted 3 years ago #

    wooow cool man
    blog

  4. siffring
    Member
    Posted 3 years ago #

    Here's a simple plugin that I think does exactly what you want.

  5. mikey1
    Member
    Posted 3 years ago #

    Hi, this plugin is very useful for vimeo and many other formats.
    http://wordpress.org/extend/plugins/vipers-video-quicktags/
    good luck.
    mike.

  6. pwyll
    Member
    Posted 3 years ago #

    equaldesign - any chance you could share the code for modifying the template file to add vimeo thru custom field?

    Thanks

  7. pwyll
    Member
    Posted 3 years ago #

    or...is there a simple way for to specify the vimeo ID and height/width in a single custom field?

Topic Closed

This topic has been closed to new replies.

About this Topic