jQuery: $ is not a function – Fix for common jQuery error

“Error: $ is not a function”, this is the error that was being thrown back at me while working on a WordPress site the other day. However for the life of me I couldn’t see why my, usual fine JavaScript code, was failing. Was it a problem with my jQuery code, my WordPress installation or both?
I reduced my code down to producing an alert when the DOM was ready, but still it threw the error:

Error: $ is not a function

Continue reading

Why is there no Page Template option when writing or editing a Page?

If there is no Page Template option when writing or editing a Page it may because there is no template file with the proper structure. For the Page Template box to be available to assign to a Page there must be a least one template file in your theme that has a structure at the beginning of the template file that looks like this:

Template Name: Links

That example is from the WordPress Default themes wp-content/themes/default/links.php file, so replace Links with your desired template name.