WP Kode

Tips, code snippets and a bunch of stuff for WordPress

Category: Code

An even better body_class for WordPress

Here is a little update to my better body_class code: So what does this thing do? It adds a the slug of the current page to the class just like the old one but it also combines Nathan Rice code for browser detection with even a little extra class called notie a.k.a. Not Internet Explorer. [...]

Use a thumbnail (or feature image) for your post automatically

Instead of creating thumbnails or special images for each post, I found that it is better to upload a full size image and then have it resized on the server on the fly (with some type of cache mechanism of course). For this, I usually use a script such as Smart Image Resizer working together [...]

A better body_class for WordPress 2.8

WordPress 2.8 introduced a very useful new tag called body_class which normally will be used like this: The only problem is that it uses the ID’s instead of the page slugs making it a little harder to use the classes on your CSS (or Javascript). A very easy way to fix this is to call [...]