More theme portfolio functionality

Project Page Next project post Post History

In an effort to keep my mind busy, I went back to look at some functionality I was attempting to build a little while ago for my website theme. I thought that having a second thumbnail image could be useful in places to help visually link posts to a portfolio project. Not another featured image, but a thumbnail size icon, something like what you might see on a desktop.

To do this I had to create a custom meta box. Inside this I then made a click-interface similar to the featured image section in posts. I managed to achieve this and are calling the same popup window that the featured image selection does. When a user updates their portfolio post, this data is sent back to the server in the usual custom meta data way that WordPress does.

Here's an image of the meta box:

The custom meta box in the portfolio post editor

Included in the meta box, once you've selected a thumbnail, are some additional options the user can select to control where the icon will be used. The final image below shows a selected thumbnail with the additional options.

The custom thumbnail meta box with some additional options

This one seems a simple but useful additional option for the custom portfolio functionality of my theme. I still have to include the additional code in the places where I want to display it, but this should be fairly simple. The plan is to use the icons on the landing page under the main title, in the blog page where the small preview images are, and potentially in a couple of other places. At some point I'll need to add some icons to each of the projects as well.