Create WordPress Post Thumbnail
So you’re wondering how everybody has that thumbnail for all of their posts in their blog’s homepage?
Well, if you’re using WordPress 2.9 (or above) then this will be a simple work for your theme. Otherwise, you would be doing extra work in preparing your theme (by means of using custom field feature).
Two things that you will be working on, are:
- Your
functions.php - Your corresponding theme file (for instance: the
index.php)
functions.php
There are two things that you can define in your theme’s functions.php file. First is the function activation line:
add_theme_support( 'post-thumbnails' );
That line will enable Post Thumbnail User Interface (inside your dashboard) for both Post and Page content types. From now on, you can see an entry field – usually on the right side of your posting screen – for “Featured Image” selection.
Now the second thing is the dimension of your thumbnails
set_post_thumbnail_size( 50, 50 );
You have two options here: box-resizing and hard-cropping. Box resizing shrinks an image proportionally (that is, without distorting it), until it fits inside the “box” you’ve specified with your width and height parameters. For example, a 100×50 image in a 50×50 box would be resized to 50×25. The benefit here is that the entire image shows. The downside is that the image produced isn’t always the same size. Sometimes it will be width-limited, and sometimes it will be height-limited. If you’d like to limit images to a certain width, but don’t care how tall they are, you can specify your width and then specify a height of 9999 or something ridiculously large that will never be hit.
Keep Your Themes Safe
There are times where I simply lack the interest to keep my things up-to-date. I’ve got my reasons. Let me tell you one; when you are doing well, no need to rush for the new trend.
Recently I’ve found a flaw (or some might use the word; bug) on WordPress 3.2.1. Not that it’s a critical one, or in such a manner that exposing your site to a security vulnerability. It simply giving people access to some things that you probably don’t want others to get their hands on.
The Uploads Folder
We all use this great engine of WordPress to simplify our interest in blog. This powerful CMS provide us with almost everything (if you are looking for the ultimate remote control, look somewhere else).
One of the great aspects of a CMS, is how it eases you getting your images and videos so that you can show them to others. Believe me, you will enjoy more in life without handling the upload process and getting the URL and stuffs all by yourself.
Full Size Image in WordPress Default Gallery
WordPress Gallery is indeed a handy tools to neatly insert your collection of pictures and order them easily in your post, without being bothered by performing manual arrangement (such as using tables, etc.) through the HTML editor. But there was this time when I feel annoyed because when one of the image in the gallery was clicked, the loaded page didn’t show a full scaled image, instead it displayed a medium-size.
I then realized that this is something that related to theme’s functionality, because there is no option to set the image size in the gallery setting.
The solution is by adding a specific template that handles the image attachment page. If you check your wp-content/themes folder, you will notice that those files that are found in there, are templates which WordPress uses to display the content of your blog (or the category, or the attachment).
By default, WordPress uses the single.php file as the template that handles all your image attachments. And this default is something that we should tinker with ![]()


