52 responses to “How to add videos to your WordPress sidebar”

  1. Darren Hoyt

    Useful stuff – thanks!

  2. Justin Tadlock

    Thanks Darren. Maybe you’ll implement this in one of your theme designs.

  3. det

    brilliant! i’m gonna try it, i was looking to create some sort of sideblog with videos!

  4. det

    i’m here again… is there a way to create a plugin with this?

    i know nothing about php and programming…

    thank you!!

  5. Alissa

    Justin, have you ever had multiple videos in a player? I’m using your video block and I’d like to have a “next video” link underneath it so users can browse right on the home page. I’ve looked at wordpress’s next_post links and haven’t quite got them to work. Any ideas?

  6. Bill

    Well, I’ve tried twice to post the whole code but it doesn’t appear to be showing up.

  7. African safari vacations

    It an interesting plugin. I would however appreciate it if someone could assist me in finding a similar plugin but one that would allow me to post mutiple videos on my African safari vacations blog.

  8. Mithila Mangedarage

    Justin you are a very smart guy.I love the Structure and thanks for that.But why all the hard work when you can copy the URL from the address bar?

  9. Justin Tadlock

    Mithila
    You can’t just copy the URL from the address bar. It won’t play. The URL in the address bar is to a page. The URL in the embed code is to the video.

  10. Mithila Mangedarage

    Thanks Justin,you saved a lot of trouble.I asked this on your other pages too,but my comment got lost amongst other comments by thankers.Is there any way to remove the “Example” page from the top page list?And how can I get other pages listed there too?You’ll see this if you see my blog,I can only have two pages and the example page which only leads to the same about page?Please help!
    Thanks.

  11. GPSchnyder

    Any Idea how to get it working with Vimeo? They do a lot more Resolution, so I choose them to show my work.

  12. Thiago Prado

    I’ve tried everything and I couldn’t put video on my blog…
    HELP ME

  13. Kirk

    I’m pretty much a novice at this. I’d like to use the Video Tabs as demonstrated on your demo for the Options dark. After figuring out the Feature Gallery I thought I could figure the Video Tabs out but it ain’t working. I’ve successfully posted the videos to their individual posts, I categorized them under Video and tagged them Video. I don’t understand what or if I need to change anywhere else. Would you direct me to the answers to this quandary. I even successfully used the sidebar widget but I didn’t seem to learn anything that would help me in this instance. The Theme is great and I’m looking forward to getting it together! Thanks.

  14. Kirk

    Gotcha!

  15. Technique

    Hi Justin.

    This is a great theme and rightly called Options because it can be used in so many different ways!

    Quick question… I want to have my videos so that in the main post they are the width that they would usually be in YouTube (425 px) but the default size in your theme. How would you recommend me going about this? Placing videos in the post in a div or span with a separate class? Perhaps by changing the following line in ‘single’ template

    if($video == true) echo $video;

    TO

    if($video == true) echo “”.$video.”";

    Please let me know if you think this would be appropriate.

    Thanks!

  16. Technique

    Ooops

    Meant to be span tags inside of those brackets!

    if($video == true) echo "".$video."";

  17. Kristian

    Hi..
    Can I just copy the video link in the widget?

  18. Todd A » YouTube troubles in Firefox

    [...] videos not appearing in Firefox. The situation was this: a client was using the hack described by Justin Tadlock here to add YouTube videos to the sidebar of his blog. The hack uses WordPress’s “custom [...]

  19. toddplex » YouTube troubles in Firefox

    [...] videos not appearing in Firefox. The situation was this: a client was using the hack described by Justin Tadlock here to add YouTube videos to the sidebar of his WordPress blog. The hack uses WordPress’s [...]

  20. Keong

    I’ve tried exactly like your tutorial and I get this msg

    Parse error: syntax error, unexpected ‘<’ in ……sidebar.php on line 205

    Why is there an unexpected ‘<’
    Anyway I can check which is line 205?

  21. MTB

    You tutorial is great. I used it on my site. Is it possible to integrate Brightcove videos using this technique. I’ve tried, but without luck. Thanks.

  22. Hi justin,
    I working on a site for my wife and i get an error when i copy the code you provided.
    Error is as follows:

    Parse error: syntax error, unexpected '<' in /lots of unnessesay info here/sidebar.php on line 45

    The entire code on the sidebar.php to show the videos looks like this:

    have_posts()) : $my_query->the_post(); 
    
    	// Get the "Video" custom field Key as an array (displays single Value in the video block)
    	$video = get_post_custom_values($key = 'Video'); 
    
    	<a href="" title="">
    
    	<div class="v video">
    
    <object type=”application/x-shockwave-flash” data=”” style=”width: 290px; height: 242px; border: none; padding: 0; margin: 0;” id=”video-block-”>
    	<param name=”movie” value=”” />
    
    <?php
    	} // endif 
    
    	// If there is no Value for the custom field Key "Video"
    else {
    
    // echo error checking to check custom field errors
    	echo 'Did not add a video URL to the custom field  Key of "Video"';
    	echo '';
    
    	} // endelse
    ?>
     

    Maybe you can get me a hint on what im doing wrong?

  23. Okidoki, will do

  24. Jay McCarthy

    I am having the same problem as kokkekniven is having above. I keep getting a Parse error: syntax error, unexpected ‘<’ in /home/thirbird/public_html/shopastylist.com/wp-content/themes/options/sidebar.php on line 77

    I cannot find the extra ‘<’

    It would be very helpful to see the entire side bar code so I can copy and paste in where I’d like. Is that possible? I am using the Options theme and I am having problems. Thanks!

  25. Arkista

    Thanks i use,

  26. Arvind

    Thanks a lot. you save me today:D

  27. Adi

    Hi Justin, I have a problem using your code.
    Something is wrong, there only latest video appears in all post and also in front page.
    Can you tell me how to solve this problem??

  28. iPAS

    Sweet ! .. Thank you very much.

  29. Movies

    Great piece of code thanks.

  30. SimonZ

    Thank you for that framework…

    i modified the section where the video is shown, cause I only add youtube videos. so I used the youtube-embed code an modified the value of the “Video”-key.

    Thak you! You helped me a lot

  31. Israel

    Hello Justin,

    I really tried from various plugins and I decided on her method, because of all that is was more appropriate to what I wanted on my site.

    Congratulations on the ability and knowledge divided us.

    Thank you.

  32. Viggo

    I’m sorry, but i cannot add a video section to sidebar. I’m crying ;(

  33. tukang nggame

    thank you has to share tips that make the more beautiful and I will try it now

  34. 20+ Tutorials and Resources for Working with Custom Fields in WordPress | Vandelay Design Blog

    [...] How to Add Videos to Your WordPress Sidebar [...]

  35. Roxanne

    Adding video is cool!!! But I’m having some problems adding it to my blog.

  36. Rudy

    I’m really happy find this tutorial… thank’s for your sharing.. :-)

  37. ~Anonymous~

    Hey i have a question. How do you actually get widgets and stuff onto the sidebar? Because i cant get anything of my choice onto the sidebar apart from the things that is already apart of the wordpress website but i just cant get anything of my own. Can you please help me.

  38. Shane Strong

    That really helped me thanks. If you would like to check some of our stuff out you can go to Chosen for more info. Thanks Again.

  39. Albert K.

    thanks, I could finally add a video to my sidebar without screwing the entire page lolz

  40. Shane

    Is it possible to pull the latest video from posts into the sidebar w/o having to key in the custom field? Thanks!

  41. Jay

    Hello, I am trying to get a flash video to play in the sidebar of my wordpress blog. No problem there, I just pasted the embed code from Flash into a text widget for the sidebar. It works on home, but when you get onto another blog page within the site, the video’s skin disappears. I read somewhere that it’s because the skin file needs to reside in the same directory as the “index.html” file. Well, obviously wordpress, because of permalinks, dynamically creates virtual directories that don’t exist. therefore the skin file can’t just be duplicated into a directory that is not there… How can I solve this problem?

    Thanks!

  42. Fresh Copy Theme | Dress Your Wordpress

    [...] To add a video simply copy the video source  ex(http://www.dailymotion.com/swf/x4v05j | http://www.youtube.com/v/WbC8Sqi3vrU )  into the custom fields value area and add the name as Video. Publish the post under the category video. The script will collect the post automatically and if vieded as a single post the video will also show up.To learn more about the script used visit Justin Tadlock’s blog. [...]

  43. Niv

    for some reason the movie is not displaying on the home page, but in every other page it does…

    Any idea?

  44. 23 articles and resources to improve your Wordpress life! | JortK.nl

    [...] How to add videos to your WordPress sidebar YouTube has become a bit of a phenomenon on the Internet, and everyone’s rushing to embed videos [...]

  45. alex

    Hi,

    Is it possible to add a video and playlist in a fixed page themplate??

    something like

    $mainVid= get_post_meta($post->ID, 'video', true);
    $playlist = get_post_meta($post->ID, 'playlist', true);
  46. AlexVerse » Blog Archive » The Power of Wordpress Custom Fields

    [...] 13. How to Add Videos to Your WordPress Sidebar [...]

  47. KyleHelps

    A lot more than I was expecting! Is there an existing plug-in or could this be made into a plug-in? The instructions are clear but code intimidates most contemporary bloggers.

Leave a Reply

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/Web site in attribution.

Please use your real name or a pseudonym (i.e., pen name, alias, nom de plume) when commenting. If you add your site name, company name, or something completely random, I'll likely change it to whatever I want.