Using custom fields on albums

WordPress has a feature called Custom Fields that allows you to put any information you want into a post. And since ProofBuddy albums are just a special type of WordPress post, you can use custom fields in your album page layouts as well.

The catch is, you typically have to edit the underlying theme files to use custom fields, and that takes a bit of skill with PHP and HTML. But thanks to a plugin called Meta Shortcode we can easily use custom fields in our templates.

Download and Install the Plugin

First, you’ll need to head over and get the Meta Shortcode plugin. It’s free, so go ahead and download it. If you need help uploading and activating it, it’s the same process as any of the ProofBuddy plugins.

Adding the Custom Field

For this example we’re going to assume that you’re working at a photograph studio with multiple photographers and want to display the photographer’s name in each of their albums.

Click on the album you’re working on to edit and look towards the bottom of the screen. You should see a Custom Fields meta box. It probably looks something like the following.

Custom fields meta box before inserting any information.

Custom fields meta box before inserting any information.

What you’re going to do is click on the Add Custom Field button and when the dropdown labeled –Select– changes to a text box you’ll enter a name and value for the custom field. It’ll look like the following.

Custom fields with the photographer field added.

Custom fields with the photographer field added.

Then, do what I usually forget and click the Add Custom Field button. The meta box will change to the following.

Custom Fields meta box with the new information added.

Custom Fields meta box with the new information added.

And you’re done with the custom fields. Click on the button on the top right to save the album.

Editing Your Templates

Now you’ll need to edit the ProofBuddy templates to display the custom fields and this is where the Meta Shortcode plugin comes in.

Click on the Templates menu under ProofBuddy and select the Image template. We’re going to assume you haven’t changed it, but if you have the screenshots may look a little different. All we need to do is add the [metafield] shortcode to our template.

Template for full sized image with the metafield shortcode added.

Template for full sized image with the metafield shortcode added.

And if you save the template and look at your album you should see something like the following.

Full image page with the information from our custom field.

Full image page with the information from our custom field.

And the same works with the thumbnail page.

First, the template.

Thumbnail page template with the photographer added.

Thumbnail page template with the photographer added.

Thumbnail page with the photographer's name added.

Thumbnail page with the photographer’s name added.

And the layout.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>