YouTube SimpleGallery

YouTube SimpleGallery on WordPress.org

YouTube SimpleGallery – new and improved!

  • YouTube SimpleGallery and Vimeo SimpleGallery have merged, i.e. they now have the same codebase. Old shortcodes still functional.
  • NEW FEATURE: It is now possible to combine video services, i.e. you can add links from YouTube and Vimeo in the same gallery.
  • NEW FEATURE: Automatically fetch titles from video service.
  • NEW FEATURE: User-defined attributes in shortcode overrides default settings: cols=x and thumbwidth=y allows for galleries with different thumb sizes, etc.
  • NEW SHORTCODE: [youtubeuserfeed user=username service=youtube] – outputs a gallery from a user’s video feed – works with both YouTube (service=youtube) and Vimeo (service=vimeo).

Usage

Make sure you go through the Options for the plugin, and set defaults to your preference.

screenshot-1

Galleries

You can now combine links from YouTube and Vimeo in the same gallery.

To embed a gallery in a Post use the following code:

[youtubegallery]
http://www.youtube.com/watch?v=cRdxXPV9GNQ
http://vimeo.com/13470805
http://www.youtube.com/watch?v=jJK-G9-dLzw
http://www.youtube.com/watch?v=S4aqM_wu6Ns
http://vimeo.com/68180971
[/youtubegallery]

If you want to add titles to the videos, add it before the link and separate with | (pipe), like this:

[youtubegallery]
Avatar Trailer HD|http://www.youtube.com/watch?v=cRdxXPV9GNQ
Eyes Close|http://vimeo.com/13470805
The Fast Show: Unlucky Alf|http://www.youtube.com/watch?v=jJK-G9-dLzw
Jožin z bažin|http://www.youtube.com/watch?v=S4aqM_wu6Ns
Mirage|http://vimeo.com/68180971
[/youtubegallery]

NOTE: If titles are added before videos, these will override titles fetched automatically from services.

The result:

[youtubegallery thumbwidth=200 cols=3]
Avatar Trailer HD|http://www.youtube.com/watch?v=cRdxXPV9GNQ
Eyes Close|http://vimeo.com/13470805
The Fast Show: Unlucky Alf|http://www.youtube.com/watch?v=jJK-G9-dLzw
Jožin z bažin|http://www.youtube.com/watch?v=S4aqM_wu6Ns
Mirage|http://vimeo.com/68180971
[/youtubegallery]

Error Reporting

If error reporting is turned on under Settings > Video, and the video service reports the video as missing/broken, the gallery will display an error message:

[youtubegallery thumbwidth=200 cols=3]
Avatar Trailer HD|http://www.youtube.com/watch?v=cRdxXPV9GNx
Eyes Close|http://vimeo.com/13470805
The Fast Show: Unlucky Alf|http://www.youtube.com/watch?v=jJK-G9-dLzw
Jožin z bažin|http://www.youtube.com/watch?v=S4aqM_wu6Ns
Mirage|http://vimeo.com/11180971
[/youtubegallery]

If error reporting is turned off, the video is simply skipped.

User Feeds

To set up a gallery that subscribes to a user’s feed, use the following shortcode:

[youtubeuserfeed user=username service=youtube]

Note that both user and service are required for the feed to work. Service is either youtube or vimeo.

Optional attributes are maxitems=x where x is the number of items to fetch:

[youtubeuserfeed user=username service=youtube maxitems=4]

Overrides

Overrides are a way of suppressing the default settings of the plugin, with attributes of your own.

Override columns with cols=x, where x is the number of thumbs per row:

[youtubegallery cols=8]

Override thumbnail width with thumbwidht=x, where x is a pixel value:

[youtubegallery thumbwidth=100]

Fetch titles from service with autotitles=fetch (or autotitles=false to not fetch):

[youtubegallery autotitles=fetch]

And, of course, you can combine them:

[youtubegallery cols=8 thumbwidth=100 autotitles=false]

These are also applicable for the [youtubeuserfeed] shortcode.

Widgets

Add a «YouTube SimpleGallery» widget to your sidebar(s), add links with linebreaks in the Links-area. You can add titles in the same way as for Posts.

Widgets have their own fields to define columns and thumbnail width.
You cannot use shortcodes in Widgets.

Supported Video Services

Supported services are YouTube and Vimeo. Other services might be added, but a requirement is that they can deliver video streams in a HTML5-compatible format.

Note that it is possible to combine videos from both services in galleries.

Support developtment





174 thoughts on “YouTube SimpleGallery

  1. Kim Ravn

    after i update to 2.0 then i cant get the thumbnails to stay side by side anymore
    this i have on my site are 4 thumpnails side by site but when i upgrade to 2.0 its only shows the
    thumbnails 1 by 1 under easother i remember long time ago we have the same problem and n ow its here again so please can you fix it

    Reply
    1. Stian Andreassen

      Have you familiarized yourself with the new settings? And the overrides in the shortcode? This sounds like a problem with columns and thumbsize. There’s a slight change in the aspect ratio of thumbnails, so check to see if you need to change thumbnail width and/or columns.

      Reply
  2. William Schwarz

    WP Wizard,

    Like the set-up of the YouTube SimpleGallery and it looks like what our company needs for the new website we are working on. In fact it’s the last piece outside a few tweaks. I looked for how to use the pluggin with a article/posting where the posting will show the thumbnail in the Loop on the home page, and the normal sized video would show in the blog/main posting page.

    Is these what I can use the YouTube SimpleGallery for and what am I missing

    Reply
  3. Damian

    After 2.0 update I cannot move widgets around or interact with them (or anything that can be dragged and dropped inside WP). Rolling back to a previous version seems to fix the issue, though, I’ve also found that the YT SimpleGallery widget (after rollback) doesn’t update when I add new YouTube videos. Any idea what the problem is?

    Reply
    1. Stian Andreassen

      This seems to be a bug that is not present in my development version, but somehow crops up in the commited version in the WordPress repository. I’ll look into it!

      Reply
  4. Daris

    I’ve been playing around with the new version of the plugin. It appears that the shortcode is stripping out any href for the title.

    So for example I used to have <a TITLE rel=”nofollow”> | and this was great cause I could link my title to other places on my site, or you could click on the image and launch the video

    Now it appears I ONLY get a text title, and the href is stripped off…? Do I need to format this different, or is this just a functional change?

    Here is a link to my video gallery page if this helps give an example of how it currently works on the old version: http://www.woodlogger.com/videos/

    Reply
        1. Stian Andreassen

          HTML in the titles was removed because they caused problems with title-tags. If this is important to you, you can modify the plugin to allow HTML in titles.

          In inc/shortcode.php, line 200, remove strip_tags from the line:

          if($youtubeoptions['title'] == 'below' && $caption ) $showgallery .= ('<div class="youtube_gallery_caption">'.strip_tags($caption).'</div>');
          Reply
          1. Daris

            Hmm I changed that line to this.

            if($youtubeoptions['title'] == 'below' &amp;&amp; $caption ) $showgallery .= (''.$caption.'');

            but didn’t seem to fix it. Must be getting removed earlier in the code. I’ll play around with this for a bit, unless you know where else I can look?

            Thanks

          2. Stian Andreassen

            Daris,

            You’re right, you’ll also want to remove it on line 163:

            if(isset($link['caption'])) $caption = strip_tags($link['caption']);

            so it says:

            if(isset($link['caption'])) $caption = $link['caption'];

            Note, though, that on line 200 you want the last bit to be:

            $showgallery .= $caption;
          3. Daris

            Thanks that worked perfectly…! Thanks for you help.

            btw, I’ve keep seeing messages on here about the the videos lining up problem. I had that when I first installed the plug-in too. They were single threaded in a straight line. I kept playing around with various settings though and eventually I noticed it just went away. I thought it was after I checked the “do not show related videos”, but I just tried to turn that off and it didn’t break it. So must not be that. I know I also resubmitted my page with links, not sure if that matters…? Has to be something simple though cause my prob went away after a little bit of playing. If I see that on my dev site again I’ll let you know so you can check it out.

  5. Kim Ravn

    yaa i am also goin back to 1.6.1 becurse 2.0 does something wrong i have tryed anything to get 4 in a row now, but it only shows 1 video in every row in 2.0 and if u set it to 2 -3 or 4 its stil, the same only one are showing so thre mush be a bug in 2.0 somewhere

    Reply
    1. Stian Andreassen

      Hi Kim,

      Are you sure the problem is with the plugin? The column-feature has been tested extensively. Have you tried on another install of WP? Or have you tried switching to another theme, to see of the bug might be in your current theme?

      Reply
      1. Kim Ravn

        naee thre are something i dont have tryed but it seems to work now in 2.0.1 but still testing to see if thre are more errors smiling good job in the updated version 2.0.1

        Reply
    2. Daris

      Hey Kim, when I was playing with ver 2.0 I was getting the same thing. When I clicked on Don’t show “Related videos:” on the video tab then it went back to lining things up the way I wanted it. You may want to try that…?

      Reply
  6. kim

    I upgraded the plugin and now the videos are all stacked one on top of the other in a single column. I had them set up in two rows of 5 each. I’ve confirmed the columns, thumb sizes and ratios and everything should working but it’s not. Any advice? I’ve had to pull all videos off this site until I can get it resolved… Thx for any help you can provide.

    Reply
    1. Stian Andreassen

      Hi Kim,

      I’ve been getting a couple of bug reports on this issue, but would very much like to see a Post or Page with a gallery, so I can look at the code. Preferably with a screenshot of the plugin’s current settings.

      Reply
    2. kim

      Stian – after the last fix that you did, everything is working beautifully for me now. No more single column and it is working across browsers. Thanks for the kickass support!

      Reply
  7. kim

    If you want to email me directly, I will send you access to a live, password protected test page and screenshots of the settings.

    Reply
    1. Stian Andreassen

      Hi Brian,

      Do you have a link I could look at? Or, alternatively, could you try to open one of the thumbs in your browser, and check to see if there’s an error message?

      From version 2.0 the plugin uses timthumb to resize/crop the thumnails to the same aspect ratio. Some webservers may have issues with timthumb. If you’re able, try to change the CHMOD on the scripts-folder, and the subfolder cache (they’re both located in the plugin folder at /wp-content/plugins/youtube-simplegallery/) to 0775 or 0777. This might help. Let me know if this works for you.

      Reply
        1. Stian Andreassen

          Brian, could you try deleting the plugin, and installing it again from scratch? Seems timthumb is missing – which might have been due to some issues I had with Subversion when commiting the latest version. If that doesn’t help, I may have to add an option to disable timthumb in the settings …

          Reply
          1. Brian

            Hey Stian

            I removed the files and then re-installed the plugin but the thumbnails still aren’t showing up.

  8. Daris

    On my video gallery it appears that everything lines up okay when I’m in Chrome. However, I just noticed that in IE 9, or Firefox they line up in a straight line.

    Here is where my video gallery is: http://www.woodlogger.com/videos/

    Are there any easy css changes that I can make to fix this?

    Reply
  9. Kim Ravn

    i ahve tryed defrent Themes also its the same som Daris does and thre are no conflicts i thin k long time ago with the 1.4 it was the same there to but at that time i got fixed

    Reply
  10. Kim Ravn

    Tryiin now 3 defrent browesers Chrome / explorer / and firefox
    just to see if its the sma ein them al
    mine are doin single colons in
    Google Chrome

    it works in “Internet Explorer” then it does all the right thing
    and it also works in Firefox

    so you can say its a problem in Google Chrome but i dont think so becurse i remember when you made the 1.4.0 it was the same but you got it fixed in 1.4.1 i mean or the version after

    Reply
  11. Kim Ravn

    it all works now i was clearing all in the in the browser and now after the update to 2.0.1 it all sems to work at my sites. testing finish and will say if something is wrong thanks for a good suport from som always

    Reply
  12. David

    Hello,
    since i’ve updated to 2.0, some pages of my blog doesn’t show thumbnails.. page seems to break.
    A title problem? i don’t understand, some pages works, some others not..

    Thanks for the good job anyway 😉

    Reply
  13. david

    Thanks a lot! i’ve reinstall 1.6.1 and all works fine now.
    Seems that with my theme, the page break randomly with 2.0.1.. i don’t understand why… i’ve updated my pages and updated youtube links and it worked again.. after a few minutes it breaks again..

    Reply
  14. tkelito

    Receiving:

    “Warning: Illegal string offset ‘cols’ in C:\Users\xxx\xxx\xxx\xxx\wp-content\plugins\youtube-simplegallery\inc\shortcode.php on line 95”

    “Warning: Illegal string offset ‘cols’ in C:\Users\xxx\xxx\xxx\xxx\wp-content\plugins\youtube-simplegallery\inc\shortcode.php on line 98”

    “Warning: Illegal string offset ‘cols’ in C:\Users\xxx\xxx\xxx\xxx\wp-content\plugins\youtube-simplegallery\inc\shortcode.php on line 224”

    Any thoughts? It is just running inside the loop on a page using shortcode, nothing fancy. Using PHP v5.4.4 in my development environment and plugin v2.0.3.

    Reply
  15. Kim Ravn

    ya it works if you post under news put if you made a new page it will break the page and its teh same in all teh templates i ahve tryed but the rest seems to function now but if you are making a new page it breaks the page

    Reply
  16. Sammy

    Ever since the latest update, this plugin does not work anymore.. I am looking for a new video plugin for my site now.. was good before the update.

    Reply
  17. Sammy

    I just reinstalled the version 1.6.1 and its working fine again… . plz let me know when your new updates are working properly. thanks

    Reply
    1. Stian Andreassen

      Hi Kim, this is not my experience. I’ve tested the plugin on several sites, with several themes, and never has a page broken because of the plugin. If this happens to you, I would very much like to see error messages. You can turn on debugging in wp-config.php by setting define('WP_DEBUG', true); – then see if the broken pages outputs an error message.

      Reply
        1. tkelito

          The code is not PHP 5.4 ready. I fixed a tons of bugs to get it working on my development environment only to push it to a staging server (using a different php version) and have it break horribly.

          Reply
          1. Kim Ravn

            this is also some i see it so he heve to do his code 5.4 compatible or else later he will get stuck becurse there will come newer versions of the php ,

  18. Requillo

    Hi there, i’ve been using the plugin, but i see that if i use shadowbox for the videos, it pops up with no video playing in it, any help please thanks

    Reply
        1. Stian Andreassen

          I took a look, and here’s the reason why videos aren’t showing:
          In your theme’s style.css, iframe is defined with z-index: -100:

          iframe, object, .youtubechannelgallery_widget-3 { position:relative; z-index:-100 !important;}

          Either remove z-index:-100 or iframe from the definition.

          Reply
  19. Merijn

    Hello!

    I just tried your plugin and it actually everything I need beside one problem.
    Like some other people here I cant get the thumbnails working. it displays the Image broken icon. Is there anyway to fix this?

    Greetings,

    Merijn

    Reply
  20. Merijn

    Haha ur a legend. Didnt even saw that option and its working. Sorry for asking before looking well hehe 😉 thanx! Great plugin!

    Reply
  21. Pierre Holstein

    Nothing works anymore on my site and it’s all based on my tutorials. Where can I get the a copy of the last version to get it all working in the meanwhile. Need to do this as quickly as possible.

    Reply
  22. Pierre Holstein

    I found the first problem
    If you have a column open between either short code the plugin shows nothing.

    For example:
    [youtubegallery]

    http://www.youtube.com/watch?v=cRdxXPV9GNQ

    http://www.youtube.com/watch?v=jJK-G9-dLzw
    http://www.youtube.com/watch?v=S4aqM_wu6Ns

    [/youtubegallery]

    or

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

    http://www.youtube.com/watch?v=jJK-G9-dLzw
    http://www.youtube.com/watch?v=S4aqM_wu6Ns

    [/youtubegallery]

    Previously the plugin worked with the empty columns. I had the spaces to be able to add content quicker without ever accidently hitting the shortcode. After removing the empty columns the thumbnails work again but still no titles.

    Reply
    1. Stian Andreassen

      Hi Pierre,

      Thanks for the heads-up, I‘ll look into the linebreak issue.

      About titles; what’s wrong? Have you added them with a pipe (|) before the links? Have you looked through the new settings page, and turned autotitles on?

      Reply
      1. Pierre Holstein

        Does the autotitles option need to be on even if you don’t want to fetch the titles from youtube?
        In that case mine did not work for me. However, after turning on the autotitles function, the title before the | replaced the youtube titles just fine.

        Reply
  23. Daniel Blumenthal

    Since I updated to 2.0.3, I can not adjust the size of thumbs.

    Here is the link:
    http://sobre.peixeurbano.com.br/seja-parceiro/

    I need the thumbs to keep 320px width. I also tried with the new short code [youtubegallery thumbwidth=320] but it’s still does not show the correct sizes.

    (Also, I needed to check the option ” Do not use Timthumb on thumbnails” in the settings to show the thumbs.)

    What I need to do to keep the width working good?

    Ps. Thanks for this plugin!

    Reply
    1. Stian Andreassen

      Hi Daniel,

      This is a problem related to dynamic CSS in YouTube SimpleGallery and sites running a cache- and/or minify-plugin. A new version will be released very shortly that’ll hopefully solve these problems.

      Reply
  24. jeremy

    How do I find hte youtube user feed and what is the specific format? Is the the full youtube url including “http://www.youtube.com/user/KurtzBrosInc/feed” for example? This is not explained in your documentation.

    Reply
      1. jeremy

        my confusion was with the “youtubeuserfeed” I though I had to find an url that was the user feed like an RSS something. I didn’t understand all I need was the youtube name in the user= field.

        Reply
      2. Grady Jackson

        HELP! user=realestatesantacruz is the only one that isn’t working?

        Can you tell me why this won’t work, while any other usernames that I try will work fine? Am I just the unlucky one out of the bunch?

        Reply
  25. Smile

    Hi everyone,

    there is an error by the new version. I’ve just updated and now the follow error code is displayed instead of the videos:

    Warning: SimpleXMLElement::__construct() [simplexmlelement.–construct]: Entity: line 1: parser error : Start tag expected, ‘<' not found in /………/wp-content/plugins/youtube-simplegallery/youtube_simplegallery.php on line 64

    Warning: SimpleXMLElement::__construct() [simplexmlelement.–construct]: Private video in /……………../wp-content/plugins/youtube-simplegallery/youtube_simplegallery.php on line 64

    Warning: SimpleXMLElement::__construct() [simplexmlelement.–construct]: ^ in /………………………/wp-content/plugins/youtube-simplegallery/youtube_simplegallery.php on line 64

    Fatal error: Exception thrown without a stack frame in Unknown on line 0

    Help, please!
    Thanks,
    Smile

    Reply
  26. Pierre Holstein

    Hey Stian,

    Sorry to repeat myself, realize you are busy, but I’m wondering if the autotitles option needs to be on even if I don’t want to fetch the titles from youtube? IOW, I only want the titles written in before the pipe to be shown. When I turn off the autotitles, all titles are gone for me.

    Also, is there anything different to this plugin that might slow down the page loading process? My site is loading very slowly since the upgrade though it may just be coincidental.

    Reply
    1. Stian Andreassen

      Pierre,

      In version 2.0.6 I’ve added an option to disable YouTube API. This should improve load time on large galleries such as yours. Please note that autotitles won’t work with the API disabled (but you’re not using them anyway). Also fixed the bug with titles, that you mentioned.

      Please update to version 2.0.6, and let me know if that helped you out. 🙂

      Reply
  27. Kim Ravn

    Hej Stian
    just to tell you after the last update it all worrks nicely on me site to, so you have again did a great job
    thanks for the patence you are showing all here

    so videos and page breaks are goen also and and all wre working tnx again Stian for thsi great plugin

    by the way i will be great if you can doit so we can post our own picture if a link are broken on a video
    but good goin adn Thanks again

    Reply
      1. Kim Ravn

        no answer in a lot of days what happen here Stian

        if you post news and you have more pages then, it breaks the page and you got big play bottons

        Reply
          1. Kim Ravn

            you explaned it self down at the next posts

            The problem seems to occour if you’re trying to include a video (in a gallery or feed) that is private. The plugin is unable to fetch video data from the API, and throws an error. I’ll fix this. In the meantime, you can probably circumvent this problem by disabling «YouTube API» under Settings > Video in the plugins settings.

            but i think its more then that but i am not shure ,after i Disabled YouTube API:
            its all seems to work so it have to be there somewhere its all goen wrong becurse if its turned on then there are page breaks and a lot of other funny stuff happen so the errors are there somewhere

  28. Stuart G

    Hi Stian

    I have been using the Youtube SimpleGallery plug-in for some time now and it has been excellent. In fact my site pretty much depends on using it.

    I hadn’t touched my site for some time then updated WP, my theme (Headway) and plug ins and now it is failing to show the videos.

    When I use in a content block I get nothing at all, and when I tried the widget I get errors listed under Warning: SimpleXMLElement::__construct() .

    Have tried reinstalling my theme and plug in but still not can’t fix it.

    Are you able to assist me?

    Thanks
    Stuart

    Reply
    1. Stuart G

      In fact I get the same errors even in int he Content block :

      Warning: SimpleXMLElement::__construct() [simplexmlelement.–construct]: Entity: line 1: parser error : Start tag expected, ‘__construct(‘Private video’) #1 /home/stu1210/public_html/celebrate-techno.com/wp-content/plugins/youtube-simplegallery/inc/shortcode.php(150): yotube_gallery_getYouTubeDataFromID(‘Z03WzB0JBQU’) #2 /home/stu1210/public_html/celebrate-techno.com/wp-content/plugins/youtube-simplegallery/inc/shortcode.php(27): global_output_youtubegallery(”, Array) #3 [internal function]: show_youtubegallery(”, ‘?Joey Bel…’, ‘youtubegallery’) #4 /home/stu1210/public_html/celebrate-techno.com/wp-includes/shortcodes.php(236): call_user_func(‘show_youtubegal…’, ”, ‘?Joey Bel…’, ‘youtubegallery’) #5 [internal function]: do_shortcode_tag(Array) #6 /home/stu1210/publi in /home/stu1210/public_html/celebrate-techno.com/wp-content/plugins/youtube-simplegallery/youtube_simplegallery.php on line 64

      Reply
    2. Stian Andreassen

      Hi Stuart,

      The problem seems to occour if you’re trying to include a video (in a gallery or feed) that is private. The plugin is unable to fetch video data from the API, and throws an error. I’ll fix this. In the meantime, you can probably circumvent this problem by disabling «YouTube API» under Settings > Video in the plugins settings.

      Reply
  29. Kim Ravn

    Hi Stian
    got a wierd problem wheni try to fets videos let say from a user some have 140 videos then its only show the first 25 of them the rest will not show up….

    and then can you mabe made a page counter so lets say if you have 20 videos on a page you can push next page and back page something like that if you know what i mean

    but if you wil look into teh problem it will be great

    Reply
  30. Fred

    With the latest version of the plugin and my old settings I was getting a series of these messages at the top of my page:

    Warning: Division by zero in /home/fredthevalet/chandlertravis.com/wp-content/plugins/youtube-simplegallery/inc/shortcode.php on line 238

    And then my various videos, only showing one vid on each row. It turns out I had “Columns” in the “Thumbnails” options set to “0”. I changed it to “3” and things display ok, but the options page still says that “0” is allowed.

    Reply
  31. Nadine

    Hi guys

    i can only view 25 videos from my user id but i have so many videos, can you please help me i need to view all the videos…

    Thanks in advance

    Reply
  32. Peter

    I don’t understand the purpose of using “user feeds”. What is the effect of using this? Are there cons or pros? Under what conditions would I want to use “user feeds”?

    Thanks,
    Peter

    Reply
  33. Dean

    Hi, I got the following error message when loading a vimeo video on

    Warning: reset() [function.reset]: Passed variable is not an array or object in /home/globalre/public_html/wp-content/plugins/youtube-simplegallery/youtube_simplegallery.php on line 76

    How do I resolve this please?

    Reply
    1. Chris H

      Dean I have the same problem, I don’t know what to do…
      This is strange, I tested it last month it was working, now my website is online, I add my first video and it’s not working anymore.
      Sometimes it shows “one” empty video icon (not working), sometimes I have this message repeated as many time as there are youtube videos :
      Warning: SimpleXMLElement::__construct() [simplexmlelement.–construct]: Entity: line 1: parser error : Start tag expected, ‘<' not found in /…/wp-content/plugins/youtube-simplegallery/youtube_simplegallery.php on line 64.

      Help Please.

      Reply
  34. geea

    hi!
    any chance this plugin could accept jetpack’s carousel lightbox instead of the default options it has now? (shadowbox, thickbox etc)

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *