A theme consists of many files, this can get very confusing very fast. What files are needed? What files runs when and why? Here are the explanations and tips about WordPress template files.

First things first, what is a template exactly? A template is a PHP file that is a part of a theme. For example, there is a template for displaying the home page, one for displaying pages and another one for displaying posts.

What Are The Existing WordPress Tempaltes?

Here is a list of the existing WordPress templates that can be used in themes:

Here is a very useful image provided by WordPress Codex (click to enlarge):

WordPress Template Hierarchy

Custom Templates

There are two main types of custom WordPress templates.

The first one are templates that WordPress looks for automatically, and if one is found it will be used. What the heck am I talking about?
If you have a category called “News” with the ID of 512 and you want the archive page of that category to have it’s own unique template you can create a new template file called category-512.php in the theme’s folder. And WordPress will use it.

This is the list of custom wordpress templates you can use:

WordPress Custom Template Drop Down

Now for the second type of WordPress custom templates.

Let’s say you have more then one page* you want to be displayed in a different way then the others. How do you do that?
Create a new file called whatever.php at your theme’s folder and inside write whatever you want instead of single.php or index.php (depending what displays the single posts at your theme).
Add this comment to the top of the file:

<?php
/*
Template Name: The Whatever Template Yo
*/
?>

(Of course change The Whatever Template Yo to the new template’s name)

Now edit (or create) the pages which you want to use this template and in the right side pick the desired template from the drop down menu. Just like in the screenshot at the right side.

*If you want to do this for posts rather then pages then you will find the Custom Post Template plugin very useful.

Any questions/corrections? Comments are always welcome.

jQuery is not defined - FireBug
Do you get “jQuery is not defined” as an error after a fresh WordPress Install? JavaScript not working at your admin panel? Don’t worry, I have the solution.

After installing two new WordPress installations with defective admin JavaScript that won’t allow me to

I understood I was having some kind problem with the Javascript jQuery library.

I deactivated all the plugins and nothing happened. Then I started looking at the source code and googeling for quite a long time. After some serious research I discovered what caused the issue.

The Problem

While uploading the WordPress installation files onto the server I had some issues that cause some of the JavaScript files to not be uploaded / be corrupted.

The Solution

wp-includes/js
Re upload the wp-includes\js folder and overwrite whatever is in there.
That’s what fixed it for me.

I hope this helped someone, if it does, or does not – comment to help or get help.

Google Text Size Change - Before and after
Are you asking yourself “Did Google just change their front search page?”, The answer is yes.
Now officially announced in their blog, The size of the buttons, text, logo and text box has increased at google.com or at any other local google home page.

This change is not browser specific and it has been verified that the change includes but not limited to: Google Chrome, Firefox, Internet Explorer and Safari.
Google says at their blog post that this change was made in order to emphasize their goal as a search engine and to show that their focus is always on search.

When I first saw the change I was convinced that me screwing around with Google Chrome’s preferences or something simillar has caused the text to be bigger until I saw Google’s post at their blog. Then I realized that It does not only happen in my computer, it happens everywhere.
Anyway, now that we are aware of actual reason, I wish you all Happy Googleing!


אורן יומטוב