J.me

WordPress Snippets part 1

Well, this will be a short list of WordPress snippets that we could use. This snippets is collected from my daily work on WordPress and should be useful for daily basis.

WordPress mail snippets

WordPress has its own improved function for sending email, it is wp_mail. We should always use this function if we wanted to send email within WordPress. With this function, we don’t need to worry much about the mail header and stuff. More over, there is plenty of filter we can use to customize it.

Customize Custom Post Type Landing Page with Clean URL

WordPress has been long capable on using custom post type. Since WordPress 3.0, we are now easier to create a custom post type. I have blogged some tips about it.

However, many didn’t know that the custom post type already had it’s own landing page, though, you will need to pass the post type variable to the URL. This post will guide you to the step by step on customizing the post type landing page, as well as adding a new rewrite rule for a cleaner URL.

Moneybookers and Paypal Bank Withdrawal Comparison

If you are working with foreign clients, chances are you will need to have accounts on either Paypal, Moneybookers or some other similar services. Paypal is currently accepted almost everywhere, it provides the best features and in my opinion, the Paypal web interface is the cleanest and easiest to use while providing a detailed information for each transaction. Moneybookers on other hand is also a growing alternative to Paypal, it is also widely accepted, but the downside for me is their web interface is somehow lacking and they didn’t provide a detailed information for each transaction like Paypal did.

They are both excellent, quick and cheap service to receive your money. Now I will going to compare the withdrawal process from both service, comparing the fee, rate and the time it needed to arrive to my bank account.

Happy New Year 2011

So we are in 2011 now. Happy new year!

Well, A little flashback to last year.

As far as my freelance career is concerned, I have improved about 158.18% compared to 2009 in earning. I have worked on small fixing project, PSD conversion project and even on a full featured website for medium business.

And on the art part, I still doing it as a hobby and improved a little over the year. Here is the compilation of my year by year progress.

Now a target in 2011:
– I will create a product and sell it in a marketplace (most likely a WordPress theme)
– Improving my work hours and balancing it with my hobby, learning something new if possible
– Buying some stuff that I was drolling on but couldn’t get one yet 😀

So that’s all. Happy new year again! Enjoy your holiday!

Ryougi Shiki Fan Art – I killed him

My latest fan art for Kara no Kyoukai’s Ryougi Shiki. This is one great anime with stunning graphics and animations. So I decide that I wanted to draw a fan art of the protagonist, Ryougi Shiki. And here it is.

Simple jQuery and CSS3 Slideshow Tabs

A slideshow and tabs is pretty common nowadays in any modern website. There is a ton of way to do this and many free and paid tools available for this feature. This make it very easy to create and it will always amaze people who see it. Basically, we will need at least Javascript to do this, CSS to style the slideshow and tabs as we wanted, and then finally the special HTML markup which make it possible. There is also a slideshow which make use of Flash.

The solution I tried to made right now is a very simple and basic one. It make use of simple jQuery to catch the click event and switching tabs, as well as the slideshow, the CSS to style it as much as we wanted and a simple HTML markup in one unordered list.

The Basics to Write a Secure PHP Web Application

Securing your application is the most important things when building an application. This is the basic that every programmer should follow, it’s a must. However, sometime programmer might forgot the basic, and the more complex your application is, the harder it is to maintain and looking for security holes. While securing your application doesn’t mean that you will be totally safe from a hack, since there is many factor of why a web can be hacked, but reduce the possibility is always a good practice.

This article will give you walkthrough on the basics of creating a secured PHP application. I will give some step by step to filtering input, keep your code up to date and standard. I’ll also give you some good practice I always do.

Best practice to clearing default text with jQuery

Having default text that we later removed when retrieving user input is common in today’s website. Many web developer use this to enhance usability of the website, so user know what to type in what field. There is a lot of way to do this, using both focus and blur event. For example, this is the shortest and easiest way that is commonly used:


 

1
<input type="text" id="example-field" name="example-field" value="Your name" onfocus="if (this.value=='Your name') this.value=''" onblur="if (this.value=='') this.value='Your name'" />

However, this approach will be a pain when you are managing a lot of input fields. You will need to type the default text three times, which can lead to a trivial typo. Also, since we check againts the default value, we will not be able to accept this value. Here is the solution, by using the simplicity and power of jQuery, this is a clean and a better way to do this.

Filter get_terms to return only terms with published post

So you are using custom taxonomy. You add terms to the taxonomy, and add the terms to your posts. Then, you use get_terms and list all your terms. Everything works fine, terms that doesn’t have any posts will not be returned if you set hide_empty argument to true. Now you move some of your posts to draft and you get a problem. Terms that doesn’t have any published posts still returned. This lead to 404 error when you click on the link of this term. It doesn’t look good now, we need to remove term that doesn’t have any published post.

So how to do that? The answer is by using WordPress filter. This piece of code below will solve the problem.

Happy Independence Day for Indonesia

Happy Independence Day for Indonesia! It has been 65 years since we have freed from colonialism, thanks to the patriots that fight back then. Well, this day remind me to my old school day where we have ceremony.

And as usual, Google also celebrate it by changing their logo. 🙂