Top

Featured Video Plugin/Widget

January 15, 2008

Featured Video automatically features the latest video you include in a post in your sidebar.

Current Version: 1.2 (January 15, 2008)

Download: Download Featured Video Here

Wordpress Compatibility: Tested on 2.3.1, probably won’t work on less than 2.3 

History:
This was a plugin that I looked and looked for when I was putting a new blog together for my Brother-in-law. He wanted to start vlogging, but he wanted to have a youtube video display in the sidebar that he didn’t have to change manually, instead he wanted it to change when he made a new post to the video category.

Well, as you can guess, I found a TON of “Easy Youtube” Post/Gallery plugins and the like, but nothing even came close to pulling a video out of a post and featuring it in the sidebar. And thus, Featured Video was born.

I based the code on Paul Bain’s EasyTube plugin, (Thanks Paul!) but modified it heavily to include the functionality I needed in addition to the easy youtube/google video posting that EasyTube provided. And then I widgetized it for added usability.

Installation Instructions:
Upload the featuredvideo.php file to your /wp-content/plugins folder, then log into your admin account, and go to the Plugins page and click “Activate” in the Featured Video row

Usage:
First, go to Options > Featured Video and set your options. You can choose the height and width of the control, whether or not you want it to autorun (not recommended, because it’s really annoying when it’s on every one of your pages), and the text for the link back to the post the video is from.

If you don’t want to display a link, you can simply leave the link box blank and it won’t display a link

To use Featured Video as a plugin:
Put <?php vsf_show_video() ?> in your theme’s sidebar file

To use Featured Video as a widget:
Point and click, baby. You can also set the title text if you want to

CSS Considerations:
The entire chunk of HTML generated by the Featured Video plugin is surrounded by <div class=”featuredvideo”>…<div> so it’s pretty easy to manipulate in CSS.

For example, if you wanted a bigger margin between the video and the link, and you wanted the link centered, try this:

.featuredvideo object {
        margin-bottom: 5px;
}

.featuredvideo .link {
        text-align: center;
}

(Since all designs are different, I can’t support the CSS on your site. If the above CSS doesn’t work for you, keep trying!)

Nuts and Bolts:
Just like Paul’s plugin, Featured Video will also parse all posts for the following syntax:

[youtube:url] and [googlevideo:url]

So, if you wanted to post a youtube video in your posts, you could use a line like this:

[youtube:http://www.youtube.com/watch?v=0md6Flcrd0s]

or Google Video:

[googlevideo:http://video.google.com/videoplay?docid=6204903272262158881]

If you use a [youtube or [googlevideo tag in any post, Featured Video will convert it to the required code for it to be displayed right there in the post. If you use one of those tags in a category that you’ve set in the Options page for Featured Video, it will display the first video from the most recent post wherever you put the <?php vsf_show_video() ?>  code.

Happy blogging!

Known Bugs:
When you delete the latest post in one of the categories you have Featured Video set up to use, the plugin knows about it, but fires its’ update code before the post delete actually happens. Workaround: Simply go to the Options > Featured Video page and click the Update button and it will pick up the correct video.

Any ideas on how I can get around that without coding a whole extra function for the delete? This case wont happen very often, so an entire function seems a little overkill.

Because this plugin/widget is provided free of charge, I simply ask you to link back to Pressography.com in a post on your blog, or from one of your sites. It doesn't need to be anything fancy - just a note saying that you're using it, and whether or not you like it. However, there is no requirement that you do this, you're free to use the plugin regardless.

Comments

46 Responses to “Featured Video Plugin/Widget”

  1. John on January 15th, 2010 3:29 pm

    Well, duhhh…excuse my previous question. In going back again, I realized that in the course of migrating the settings to the dev site, the category was unchecked, so once I checked a category, all is well.

    Great Plugin.

  2. John on January 15th, 2010 2:29 pm

    I’ve been using the plugin successfully for some time. Today I setup a test copy of the blog, and upgraded to Version 2.9.1, and now I’m getting a “There is no video to display just yet” message in the side bar. I reset the settings, deactivated and re-activated the plugin, and used the template tag rather than the widget, all with the same result…Oh, and I added a new post as well.

    Any thoughts about what might have happened?

  3. Tyler on January 2nd, 2010 7:47 pm

    Has anyone figured out how to add other syntax other than the youtube and google ones?

  4. O2H2D2 | Matt on October 30th, 2009 11:19 pm

    Have 2.8+ WP

    After following the coding progression on this carefully, I finally got it to work.

    This is an awesome plugin, though use at your own risk. lol May take 2-3 days for novices to install. That’s me!

    FF3 and flash are having a battle of not talking with each other to figure out the flash issues with the browser. Basically Adobe is not really talking, to get the issue resolved.

    Thanks to Jason, and ivan and freakery

  5. Shane on October 23rd, 2009 9:54 am

    I’m trying to get this plugin to pull the latest video from my video category, but I’ve been inserting videos using the WP 2.8+ method, which looks like:

    Would this be a simple fix to get the plugin to work using this method?

    Thanks!

  6. Ram on October 11th, 2009 3:29 pm

    “There is no video to display just yet” …. why am i getting this message even though i have configured my featured video plugin .. this is what i have done .. i set the height, width and placed a youtube video as said like [youtube:http://www.youtube.com/watch?v=jP3dRM9C1z4&feature=fvhl]

    and i am still getting a problem and displaying the message as i have quoted above .. can you tell me a solution for this

    Thanks
    Ram

  7. ruz on October 8th, 2009 9:29 am

    can some one tell me how to get this to work on private posts? te syntax it needs doesnt embed in rss, and i want to create a private post where i can just dump all the necessary links

    cheers

  8. igor on September 21st, 2009 4:45 am

    I have 1 problem. When I use widget, and put video before tag more – video don’t show in post and I have a message, that I have a problem with my flash player/ When video put after tag more – it’s all ok.

    Why?

  9. BJohnM on September 9th, 2009 7:38 pm

    @BJohnM

    I messed some of the explanation up badly. Let me clarify:

    Where I said, “so all I should have to do is change that to start with “[" (first character of the end code) and end with [/youtube].”

    I should have said, “so all I should have to do is change his shortcodes to start with [youtube] or [googlevideo] and end with “[” which is the first character of the closing shortcode.

    Sorry about the confusion.

    Comment Tags: php, shortcode
  10. BJohnM on September 9th, 2009 7:33 pm

    The plugin installed and is working perfectly for me on my site.

    However, I’ve got a question. First, let me say I am no programmer or developer, and only tinker. I have no real understanding of php, but I’m learning (slowly).

    I am fine using your short code of [youtube:url], but for a long time I’ve been using Viper’s Video Quick tags to embed videos into a post, and…for what it does, it’s great because you don’t have to remember codes. It puts buttons on the editor for YouTube and Google Video (and others). Click on the button, there’s a popup and you just paste in the URL. The generated syntax of the short code it uses are [youtube]url[/youtube] (same for Google).

    So, I thought I’d be cute and see if I couldn’t make your plugin work Viper’s. (So, I understand if you’re not interested in helping with this…don’t worry about it.) So I’m thinking, OK, in his code, somewhere he set’s a parameter for your shortcode, so all I should have to do is change that to start with “[" (first character of the end code) and end with [/youtube]. Leave the rest of the code intact and it’ll work. Of course, it didn’t. I’m sure that doesn’t surprise you.

    I changed line 74 to read: $regex = ‘/\[(youtube|googlevideo)](.*?)[/i';

    Line 105 to read: $regex = '/\[youtube](.*?)[/i';

    Line 138 to read: $regex = '/\[googlevideo](.*?)[/i’;

    When it attempts to run, I get, in the article an error on line 106 and 139…again, something I’m sure you would expect.

    Anyway, if you can quit laughing at my programming ignorance, and are so inclined, any direction would be great (it’s just a fun thing to do, and the way i’m trying to learn). Not critical, since you way works just fine for the purposes I need.

    Thanks again for a great plugin.

    Comment Tags: quick tags, short codes
  11. Ryan on August 26th, 2009 11:39 am

    If I add two videos posts on the same day, even with the altered SQL statement it still pick the earlier one first? Of course, if I have them on separate days then it picks the later one. Any thoughts?

    @ivan -

  12. Brian on August 12th, 2009 3:20 am

    Really superb plugin!

    No problems with it bar one.. I embed a YouTube video in a post by using:

    [youtube:http://www.youtube.com/watch?v=XXXXXXXX]

    The video displays in the sidebar fine (as the Featured Video), but the same video embedded in the post doesn’t work in Firefox on my Mac. Is it just me?!

  13. ivan on April 24th, 2009 1:20 pm

    hmm so that works, i got question for all of you

    how do i exclude posting video in my post ??

    so i dont want it to show in posts

  14. ivan on April 24th, 2009 1:15 pm

    hey guys, there is simple tweak to get this working right (to show latest video)

    open featuredvideo.php and add ORDER BY post_date DESC”;
    so the whole section of code looks like:

    $sql = “SELECT distinct ID, post_title, post_date, post_content
    FROM {$prefix}posts, {$prefix}term_relationships, {$prefix}term_taxonomy
    WHERE {$prefix}posts.ID = {$prefix}term_relationships.object_id
    AND {$prefix}term_relationships.term_taxonomy_id = {$prefix}term_taxonomy.term_taxonomy_id
    AND {$prefix}term_taxonomy.taxonomy = ‘category’
    {$catsql}
    AND post_status = ‘publish’
    AND post_type != ‘page’
    ORDER BY post_date DESC”;

    **note: you have to delete symbol ; after the ‘page’. The symbol “;” has to be at the end of that code section..

    Cheers

  15. spencer on April 23rd, 2009 12:02 am

    cannot load videosidebar.php
    (it doesnt exist.. tthis is when i edit the featured video widget it sends me to videosidebar.php wich you forgot to include in your download..
    are you an imbecile?
    im deinstalling your useless widget

    Comment Tags: nonexistent files
  16. spencer on April 22nd, 2009 11:57 pm

    i now included all categories to make sure, and it doesnt work buddy.. which is probably the reason why this plugin is no longer listed in the wordpress plugin cp?

    Comment Tags: crap
  17. spencer on April 22nd, 2009 11:52 pm

    doesnt work mate i set it up correctly chmodd 777 the plugin installs, and i included the category with all videos on the admin backend control panel for this plugin but it says “There is no video to display just yet”
    doesnt work

    Comment Tags: faulty plugin
  18. Brian on April 14th, 2009 1:43 pm

    Can I pull video from another blog and feature it in a sidebar widget using this plug-in? I can’t seem to find what I need anywhere. Any help would be greatly appreciated.

  19. Brian on April 14th, 2009 1:39 pm

    This plug-in is the closest I found to the type of program I need. I want to place Video posts in a sidebar, but the video posts are coming from another blog site. Can I use this plug-in to pull the latest post from another site (www.vaalbarany.com/videojournalblog) and place in the sidebar via a widget?

    Any help would be greatly appreciated.

  20. sam on April 9th, 2009 7:05 pm

    can u use other vids than google and youtube that show up in featured video

  21. Pierre on April 7th, 2009 11:33 am

    Hello
    This is q nice pluggin however i have got a problem
    when i put a google video i don t know why but the video play automaticly in the sidebar but i have set up the option and when it asks me “Play The Video When The Page Loads?” i have selected “no”

    Does anyone know how to do for to swtch off or take off the autoplay ???

  22. ChuckMcB on March 17th, 2009 6:03 pm

    Nice hack freakery. Working well for me. Cheers!

  23. Ed on March 12th, 2009 8:41 am

    @Ed – sorry that should be:

    ‘I’ve added the ?php vsf_show_video() ? code to my page-sidebar.php’

  24. Ed on March 12th, 2009 8:37 am

    Thanks, this is exactly what I’ve been looking for..

    Is there a way to have featured videos on a page’s sidebar? I’ve added to my page-sidebar.php but its not displaying my latest video. I just get ‘There is no video to display just yet’.

    I’ve tried going into settings and hitting ‘update’ but no joy. Any ideas?
    (using wordpress 2.7)

    Cheers

  25. freakery on March 11th, 2009 5:02 am

    okay got it to update automatically! YAY!

    look for the commented widget code eg.

    //===================================
    // Widget Code
    //===================================

    (ADD THIS!) vsf_get_latest_video(0);

    YAY!

  26. freakery on March 11th, 2009 4:57 am

    okay i got the plugin to select videos randomly with a simple shuffle(); function

    right after
    * $posts = (array)$wpdb->get_results($sql); *

    i added
    * shuffle($posts); *

    seems to work ONLY if I press the update button in the admin section. Is there a way around this (automatically updates when I refresh the page)

    cheers

  27. rohith on March 8th, 2009 1:19 am

    hai
    i install the plugin and upload the video in google ( http://video.google.com/videoplay?docid=5609658004883630305 ) how i point to my website please help me
    thank you

  28. ChuckMcB on February 11th, 2009 6:23 am

    Another couple of suggestions:

    - add the video usage/syntax to the admin page as a reminder
    - parse pages as well as posts looking for videos (on one of my sites all my videos are on pages)

  29. ChuckMcB on February 5th, 2009 10:22 am

    Nice plugin, came bundled with a theme I’ve started using. Did a couple of hacks to stop it displaying related items (add &rel=0 to the video QS)

    Any chance of a quick hack that randomly picks a video rather than one that was in the last post?

    TIA

  30. Martin on January 24th, 2009 7:45 pm

    Hi,

    This is exactly the sort of thing I was after, but I seem to be having same trouble as the rest.. the videos within my new posts don’t seem to be updating so it just keeps displaying the first video all the time..
    I really really want to try and get this to work!…

    Was this fixed, did I miss something.. or..

    Many Thanks

    M

  31. Editor on January 7th, 2009 9:40 pm

    Originally Posted By DaveHas the old/new post bug been solved??

    I’m trying to use this on my blog, but it is only pulling the earliest video post…..

    Same for me. Updating files doesn’t help. Adding “ORDER BY post_date DESC”; to the end of the $sql function in featuredvideo.php (as suggested elsewhere on the Web) just breaks everything.

  32. Dave on December 19th, 2008 10:36 am

    Has the old/new post bug been solved??

    I’m trying to use this on my blog, but it is only pulling the earliest video post…..

  33. Danny Foo on December 1st, 2008 3:53 am

    Originally Posted By Danny Foo

    Originally Posted By Danny FooI’m facing a bug – I think.

    I installed on Wordpress 2.6. Even after I posted 2 new videos, the first video is still displaying. When I unpublished the first post, the most recent video (of the 2) shows.

    I’ve tried the Update method – doesn’t work.

    Any other suggestions? Thanks.

    Just to update. It’s only displaying the most 2 recent videos. In other words, I’ve to unpublish/delete oldest 1 (if there’s 3) before the most recent will display.

    Hope that’s understood.

    Okie. Found a probable cause.

    It’s not pulling the latest but the earliest post published. Weird.

  34. Danny Foo on December 1st, 2008 3:47 am

    Originally Posted By Danny FooI’m facing a bug – I think.

    I installed on Wordpress 2.6. Even after I posted 2 new videos, the first video is still displaying. When I unpublished the first post, the most recent video (of the 2) shows.

    I’ve tried the Update method – doesn’t work.

    Any other suggestions? Thanks.

    Just to update. It’s only displaying the most 2 recent videos. In other words, I’ve to unpublish/delete oldest 1 (if there’s 3) before the most recent will display.

    Hope that’s understood.

  35. Danny Foo on December 1st, 2008 3:43 am

    I’m facing a bug – I think.

    I installed on Wordpress 2.6. Even after I posted 2 new videos, the first video is still displaying. When I unpublished the first post, the most recent video (of the 2) shows.

    I’ve tried the Update method – doesn’t work.

    Any other suggestions? Thanks.

  36. Danny Foo on November 19th, 2008 10:27 pm

    Awesome simple plugin. But you might need to re-look into the code because of Firefox 3.

    Firefox 3:
    Keeps displaying; You need to have flashplayer enabled to watch this Google video.

    Even with the latest Flash player, it still does it. No idea why.

  37. Vladimir on October 30th, 2008 1:23 pm

    Just installed the plugin. Seemed to be working well. But now I just uploaded a new video and the old video still shows. Any ideas why?

    I’ve also tried to update the options just to make sure it recognizes the latest video.

  38. Alex on September 19th, 2008 3:12 pm

    @Alex – Never mind! I just figured out that putting link text in Settings > Featured Video will point to the post. Awesome. Sorry to bother you. . .

  39. Alex on September 19th, 2008 1:46 pm

    Very nice and easy plugin, and I’m happy to link back. Thanks!
    P.S. Can I add parameters, like a title, to the PHP or [youtube] code?

  40. Jason on June 12th, 2008 10:29 am

    @Frank – Yep, that’s what this plugin does – it takes the latest video you post (using the [youtube] or [googlevideo] tags, as mentioned on this page) and puts it in the widget

  41. Frank on June 11th, 2008 4:50 am

    Hi, can i show always the “last/latest” postet Video and not the most Featured?
    I have an Category in my Blog with Videos, but the Category is Hidden.

    I hope you can understand my English.

    Greetings Frank

  42. Essential Plugins For Wordpress 2.6.2 - blog - BlueBoxSols.com on March 3rd, 2009 6:44 am

    [...] Featured Video automatically features the latest video you include in a post in your sidebar. Not necessary if you do not post videos obviously. Download [...]

  43. Featured Video Plugin For WordPress « DreamWeaver Kit on March 2nd, 2009 1:38 pm

    [...] WordPress Featured Video Plugin is a very useful and powerful feature to add in your wordpress blog. * It  reads and displays a [...]

  44. Featured Video Plugin - Widget - WP Plugin Archive on October 17th, 2008 3:21 am

    [...] Featured Video Plugin – Widget von Jason DeVelvis featured automatisch das zuletzt in einem Beitrag eingebundene Video über [...]

  45. Featured Video Plugin For WordPress » » Saheltech Blog on July 26th, 2008 2:33 pm

    [...] WordPress Featured Video Plugin is a very useful and powerful feature to add in your wordpress blog. * It woudl read and display a [...]

  46. Featured Images Widget : Pressography on January 22nd, 2008 11:36 pm

    [...] After creating the Featured Video plugin, I was looking at the front page of this blog, and thought it would be really great to be [...]

Got something to say?





Tags:
Separate individual tags by commas
Bottom