J.me

Some useful tips for WordPress custom post type and taxonomy

Custom post type is one of the most powerful WordPress feature. It allows us to create just any content we need, combined with custom taxonomy, the possibility is just endless. WordPress have allowed to have custom post type and taxonomy for some while, but with WordPress 3, everything is far more easier. We have register_post_type and register_taxonomy created specifically for this purpose.

While this two combined to be a wonderful addition for your WordPress blog, there is still a lot of things that is not yet documented. Here is a few useful tips I collected when working with custom post type and taxonomy.

Blog redesign

Welcome to my new redesigned blog! It’s been a year and a half since the last time I changed the design. I have always wanted to change it, but I just always don’t have enough time. 🙂 I know I’m not that good enough in designing, but at least, this is the best design I ever made until now!

The idea behind this design is, to make a simple, usable layout and still looks beautiful. There is a lot of tutorial on the web that helped me when making this. I try to make the website small in size, so you’ll able to load it fast enough. There is also a cool trick on the background, which still make the markup small without much wrapping div over div to accomplish the effect. I also realize the importance on social networking nowadays, so I add links to some of my account. 🙂

Checking the current post type with is_singular function

The WordPress 3 introduce a new feature that let us easily make our own custom post type. This is really a cool feature that give more possibility to customize the WordPress powered website. However, I find that the documentation is not complete yet.

In the recent problem I got, it requires me to check the current post type, something like is_single for post and is_page for page. Luckily enough, the is_singular is now changed to accept a parameter, and that is post type. 🙂

In current codex page, it still not updated. However, now we can use this to check whether we are on our post type page or not.

if ( is_singular(“my-post-type”) )
// whatever you want to do here

Great!

CSS Captcha 0.1 beta

With coming of the CSS 3, it is now possible to draw using merely HTML and CSS. After seeing some awesome work that can be done with CSS 3, one of my friend suddenly get an idea to create a captcha. Thinking that bot today might haven’t able to pass this kind of captcha, I created this, CSS Captcha. The captcha that didn’t use any image. It just simply using HTML and CSS to draw characters in your screen. I might be not the first one to create this though. 🙂

Click here for demonstration

Moving Stick Figure with CSS 3 and jQuery

With CSS 3, creating a stick figure is easy and fun. But it is even better if it can move. So here it is

Click here for the demo.

This currently worked on Google Chrome and Safari. However, in my test, Safari lagged a lot in the animation. So Google Chrome performed the best!

Enjoy… 😀

Update: This is also submitted on Smashing Magazine CSS 3 Contest, you can preview and download from there too. 🙂

Pure CSS Dropdown with a Little CSS 3 Juice

Menu dropdown is one of the feature that almost every today webs have and it is one of the most popular feature used in the web. In past, such feature need Javascript event. Such as using onMouseOver or onMouseOut event. However, since CSS introduced, the new psuedo classes now have this ability. Also, this solution is work for all major browser, except, of course for the CSS3 juice added, which is currently only worked on web-kit browser such as Chrome and Safari. 🙂

ZN5 Backup Tools 1.0

Here is my ZN5 version of Backup Tools.

Even though it used the same name as my E2 version, the code is completely different. I rewrite the code to make sure it would worked well in my ZN5. This is written in Bash and requires showQ and showRadio. So any modded firmware should be able to run this. In addition, you need to have Mgx Box, MPKG Box, or similar software to install MGX.

I just added some basic features for the backup and restore. The backup file is stored in tar archive and the file name is generated by date. By default, the backup file is stored in /mmc/mmca1/backup, you can change it anyway.

It support backup and restore following data:

  • Contact, SMS, and other related data stored in /ezxlocal/sysDatabase/main.db
  • Menu Tree
    this should work only on the same firmware, so it is useful when you want to try a new firmware and then return to your old firmware, you restore this file and your menu tree will still the same as before you flashed
  • Web Profiles
  • Settings
    I would recommend you to restore this on the same firmware, although it might worked fine to use the backup for the other firmware

The best feature it has is it support multiple backup. So you can choose to restore backup from any date you want (as long as you have the backup). 🙂

Download

If the download didn’t work, try to right click and choose save link as (or other similar option in your browser).

Hope you find it useful. Cheers… 🙂

Any comments, suggestions and bugs report are welcome. Thanks.

Link Menu 1.0 – jQuery Plugin

Hello there.

I would like to share a jQuery plugin I created some day ago. This is called Link Menu, and currently on version 1.0. This plugin will add a menu box on your link when clicked or double clicked, you can set it on option.

I have used this on my blog if you noticed. 😉

Demo

Download

This file is released under the term of GNU GPL.

Hope you find it useful.

Thank you.

Installing Aptana Studio on Ubuntu 9.04

aptana

Aptana Studio is a powerful IDE for web development. It supports HTML, CSS, Javascript and the server side script such as PHP, Ruby and Python. Even more, it support a wide variety of Javascript library. It based on Eclipse and available as a standalone application or as a plugin for Eclipse. Aptana Studio is available on Windows, Mac and Linux. And the best of all is, Aptana Studio is free. Here I will post how I install the recent version of standalone Aptana Studio, 1.5, on 32 bit Ubuntu 9.04 Jaunty Jackalope.

First of all, download the Aptana Studio on http://www.aptana.org, choose the Linux and 32 bit version, or change it accordingly to suit your machine. Before we start installing the Aptana Studio, we need to ensure we have installed the sun-java6-jre and sun-java6-plugin. To do that, simply type this in terminal

PHP code, searching combination of T9

T9, which stands for Text on 9 keys, is a patented[1] predictive text technology for mobile phones, originally developed by Tegic Communications, now part of Nuance Communications[2]. Read more on Wikipedia

This is usually used in mobile phones for predictive alphabet input. Each key have associated letters, such as 2 for ABC, 3 for DEF, and so on… This function allow you to search combination from entered number, for example, input 23 will return ad, ae, af, bd, be, bf, cd, ce and cf, in array.