Archive for September, 2009

How to use widget multiple times

In Wordpress 2.8, there’s a new widget API. The new widgets API is a class that abstracts away much of the complexity involved in writing a widget, especially multi-widgets.

Basically, you extend WP_Widget with your own class that provides a constructor and three methods — widget(), form(), and update().

  • widget() – outputs the actual content of the widget.
  • update() – processes options to be saved.
  • form() – outputs the options form.

* The WP_Widget source can be viewed here (read the phpdoc for moreinfo on usage): http://core.trac.wordpress.org/browser/trunk/wp-includes/widgets.php
* You can see examples of how to use it here: http://core.trac.wordpress.org/browser/trunk/wp-includes/default-widgets.php

Here’s an execelent example of the widget.

, , , , , , , , ,

No Comments

Starting Ruby programming

Ruby is an object-oriented scripting languages.

Here are steps to do Ruby programming:

  • Download the Ruby package here.
  • Install the package.

To start your first Ruby script, right click your desktop, and add New “Ruby Program“. Give the file .rb extension. Right click the file and click Edit. Copy this code to the file:

#!/usr/bin/env rubyputs “Hello world!”
gets # This will pause, and wait for user press enter.

, , , ,

No Comments

Does Google prefer Valid HTML & CSS

I recently heard my friend saying that valid HTML & CSS is impotant. It can make your website rank higher in Google search. Is that true?? To prove this I browse a lot about this, and here’s the result:

  • From site-reference.com, saying that “Not only did Google rank both sites with obviously wrong HTML higher, they even refused to include one of the sites with valid HTML altogether“!
  • A discussion from webmasterworld. My summary, valid HTML does not help your ranking but probably will help you get indexed.
  • From streetdirectory. “How important is valid html if Google, Yahoo!, and MSN don’t even practice it themselves?”

So for me, if I have time, I will do the validation. It’s not too important for me.

, , , , , , , , ,

No Comments