02 Jun 2011

When something is not documented

… look at the source code

10 Mar 2011

This domain is

… 9 years old

24 Apr 2010

WordPress.org Support Forum

For the past couple of weeks, I suddenly had an urge to hang out at WordPress.org support forum. All I can say that it was a whole new experience. Reminds me a lot when I was active in K2 forum – answering question and request free of charge!

I think my WordPress ninja skill has been upgraded to another level.

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.