How to add a counter to your post_class in WordPress

For the redesign of this site, I wanted to implement various design elements, in particular related to the Responsive Design, made possible by iThemes Builder.

One of those elements is that when visiting the home (blog index) page in mobile view, only the excerpt on the first post is displayed, all other posts are displayed as titles only. Of course, I could have edited the theme file to add a counter, and conditional code to display or not display the excerpt. However, I try to minimise changes to template files, and prefer to use a function, and CSS to accomplish such functionality.

I [...]

How to add featured image thumbnails to WordPress posts and pages, the easy way

Since WordPress version 2.9, featured images (formerly known as "post thumbnails") are integrated in the Write Post and Write Page panel. Not all WordPress themes make use of these fields, and a change to your template files is required.

In this post I will explain how you can add Featured Images to your posts and pages with only a modification to your functions.php file, and some basic styling using css. This is in particular useful when you have multiple Page templates, and therefore need to update several files to incorporate the featured images in each page.

(more…)