For a recent project I wanted to do something a little different with the list of categories in the sidebar. Instead of simply listing each category, I wanted to list an excerpt from the last post in that category.
I wasn’t quite sure how to do this although I did know that I needed an array of the categories I wanted to use. After a little trial and error and asking a friend a question, I came up with the following piece of code.