Posts Tagged ‘wordpress’

WordPress Video Galleries with NextGen and jQuery

Thursday, April 9th, 2009

For one of my recent WordPress projects I needed an easy way for the client to organize and display videos. Unfortunately my hope that NextGen Gallery plugin, which I already used for the images, will do the trick vanished after couple of clicks and I started googling for a solution. Since neither google nor Worpdress Plugins page gave me anything reasonable I started rethinking the situation:

  1. I was already using Shadowbox which allows displaying videos
  2. I already had jQuery enabled in my WordPress Theme
  3. I can use the alt field in the NextGen options for the url of the video

So what I needed was to modify the generated from NextGen anchor (the href attribute) and somehow to distinguish if the  thumbnail is for image or video.

Here is the script I wrote which does both things:

jQuery(document).ready(function($){
  $(".ngg-gallery-thumbnail a").each(function (arr){
    if ($(this).attr("title").substr(0,5)=="Video"){
      $(this).attr("rel","shadowbox;width=405;height=340");
      $(this).attr("href",$(this).children("img").attr("title"));
    }
  })
});

All you have to do to make it work is:

  1. Include this Javascript somewhere on your page
  2. Put the url for your video in the alt textfield
  3. Start your descriptions with “Video”

If you found this script useful consider donating. Hosting isn’t free you know. Thanks!

Downtime due to WordPress 2.5 high CPU usage

Wednesday, April 30th, 2008

Sorry for the downtime guys. I have reached my CPU usage limit due to turning on automatic database backup feature in WordPress (or something else – not quite sure).

Lets hope from now on everything will be ok.

Update:

With my blog suspended for second time I got really pissed and investigated the reasons. My previous believes about buggy pluggins was not correct and with little googling I found out that WordPress 2.5.x has some serious problem with CPU usage. As I examined my load logs it is obvious that the PHP process is using more than 5 times as previous versions.

The solution is either to install WP Super Cache or to downgrade to the previous version before 2.5.

Xedunism is Alive – My Second WordPress Theme

Tuesday, February 26th, 2008

Finally this blog has some decent look. After 2-3 days of coding xhtml/css and playing around with the few graphical elements this theme went public under the name Xedunism – Cheerz! I know it is not very colorful but I wanted a nice, clean and easy to read layout. I hope you like it and if you have any comments please drop me a line 🙂

Legal stuff:

There are still bits and pieces from Kubrick Theme so – http://binarybonsai.com/wordpress/kubrick/

Floral element (top right) comes from – http://ro-stock.deviantart.com/art/Floral-Deco-Brushes-2-54001452

RSS Icons are from the Oxygen Icon Theme – http://www.oxygen-icons.org/

If there are any licenses i have broke please contact me and i will take the needed measures.

Thanks