Understand WordPress Child Theme

With version 3.0 of WordPress, the much anticipated feature of Child Themes was integrated or some might say it was improved, since it was actually possible to use it. I like to show you an example based on the new default Theme TwentyTen how you use it. Another example can be found in my WP Basis-Theme (SVN); currently not HTML 5 version.

The function of the Child Themes can be applied basically in every theme and the new features facilitate access and creation of a Child Themes. Before there were also possibilities to change a Theme without changing the actual files of the theme. With the support of Child Themes this is now completely independent and we can use a theme that can be updated without a problem, and you can still realize your own ideas.

Other blogs already mentioned Child Themes but I've found so far only posts where they just talking about the activation and modification of the style sheet. Therefore, I would like to comment this subject only briefly, which is quite simple and then show the different possibilities in terms of template files.
Continue reading …

Custom Post Type and Permalink

Since WordPress 3.0 you can use Custom Post Types and you can define your own types of content - it's more like pages than posts! Thereby you can use automatically the Permalink structure of your WordPress installation. That means, if you create a new post type, you can use Permalinks.

But the Permalinks only work if you recreate the Rewrite Rules of WordPress - that's why many users initially have problems with it. If you create a new post type you probably get a 404 if you open this page because WordPress doesn't know the URL-structure in your Permalinks since you didn't create the Rewrite Rules again.

The easiest way is to safe the Permalink structure in your settings again. Alternatively you can include in your Plugin or Theme the function flush_rewrite_rules(). This enables to create the Rewrite Rules again. Important: Flush rules only on activation or deactivation. Don't do it on any other hook.

Individual Design for any Page

The blog has a Theme and for every page an extra style sheet. This current trend of individuality for each content is very common today. Even with WordPress, you can do so; there are several possibilities. One possibility is to create, based on the title, the individual stylesheet.
By default, the class assignment of function body_class() has already a lot of possibilities. More individuality can be reached with the title or ID.
It is certainly not worth for a traditional blog environment but for a site with little content it works pretty well. As I have implemented in this case.
Continue reading …

Small Tips Using WordPress and jQuery

Inside of WordPress are several of JavaScript libraries available, you can use them easily and you don't need an extra Theme or Plugins. Also, this is the recommended approach to enable libraries , so they won't be loaded more than once. Some notes on these two topics can be found in the article Use JavaScript Libraries In And Of WordPress.

But from time to time you need something specific, so I have some code snippets for you in this post now. And I particularly want to show some examples with jQuery. Many Themes and Plugins using jQuery and it is pretty easy to work with jQuery. In principle, these hooks and calls also apply to your own scripts and other libraries.
Continue reading …