Displaying Related Posts in WordPress

There are quite a few plug-ins that are capable of displaying lists of posts that are related to the one currently being viewed in WordPress. However, sometimes they might not offer quite enough customization, or they may just be too much overhead for the features they provide.

If you are interested in displaying related posts without a plug-in, you can start with the code shown below; then customize it however you see fit. 

WordPress Post Thumbnails

Although there was initially a lot of fanfare over the new “thumbnail” features that were added to WordPress when version 2.9 was released, the documentation for the various functions related to post thumbnails is still severely lacking. In this article, I hope to shed a little light on the subject, as far as I can understand it.¬†There are four new functions related to post thumbnails. Following are some short explanations about what the functions do and how to use them.

WordPress: Style Top Level Pages Differently

Recently, I needed to figure out how to apply different styles to the top level pages on a WordPress site than those applied to child pages. After a little digging, I figured out a fairly easy way to determine which is which.

Granted, I could easily create a custom page template and assign it to each of my top level pages, but that would require anyone creating new pages to recognize whether or not the custom template is supposed to be applied, and that change would have to be made any time a page is moved.

Instead, I wrote some simple functions to check whether or not a page is a child page or not. I then use that function to assign a specific class to the elements that need to be styled differently.