08 Jun 2009

Malaysia PlayStation®Store

Malaysia PlayStation®Store is officially launched – finally.

17 Apr 2009

Maybank2u.com System Refresh

Maybank2u.com System Refresh

Some thing never change. Animated GIF FTW!

15 Apr 2009

WordPress [gallery]: Force x Number of Columns

Does anyone know the easiest way for WordPress [gallery] to force x number of columns display without tampering the core or manually set the columns value to the shortcode?

I could only figure out 2 possible ways:

  1. function / code duplication
  2. Regular expression

If you use [gallery] shortcode without setting the columns value, the default is set to 3. Some WordPress theme can either fit 3 or more column per row or less. Below is an example to force [gallery] columns to 2 to any post or page that uses [gallery] shortcode:

function gallery_columns($content){
	$columns = 2;
	$pattern = array(
		'/(\[gallery(.*?)columns="([0-9])"(.*?)\])/ie',
		'/(\[gallery\])/ie',
		'/(\[gallery(.*?)\])/ie'
	);
	$replace = 'stripslashes(strstr("\1", "columns=\"$columns\"") ? "\1" : "[gallery \2 \4 columns=\"$columns\"]")';

	return preg_replace($pattern, $replace, $content);
}

add_filter('the_content', 'gallery_columns');

$columns can be set to any numeric value. If [gallery] columns is set to 0, no row breaks will be included.

There are probably some hidden drawbacks to the method above. Feel free to share if you have any other solution.

11 Apr 2009

Money is the motivation

I hate to admit this but if it wasn’t for that particular someone that pay me (or was it a donation?) to update this theme, it probably took ages for me to do so.

It feels really great once you start to see the result. This probably too late to mention, but WordPress 2.7 is awesome. Sticky post, comment threading and paging, reply to comments, new template tags has been added to this theme. Hoping to repackage it soon for public consumption.

10 Apr 2009

External Content

Relying on external content can be no fun at all. Especially dealing with broken link, deleted media etc. If it’s mine or belong to me, that wouldn’t be a problem. YouTube videos, flickr photos — now who doesn’t link or embed to that.

So I guess that’s why we see a lot of duplicate video in YouTube. Probably just in case.

20 Feb 2009

Remove WordPress [gallery] shortcode embedded stylesheet

Dump this code anywhere in Theme’s template functions.php file (For example, functions.php file for a Theme named “default” would probably reside in the directory wp-content/themes/default/functions.php):

function remove_gallery_style() {
  return "<div class='gallery'>";
}

add_filter('gallery_style', 'remove_gallery_style');

And these are the classes for your stylesheet:

.gallery {}
.gallery-item {}
.gallery-icon {}
.gallery-caption {}
17 Jan 2009

WordPress.tv

WordPress.tv — a great visual resource for those WordPress user who doesn’t like to read.