Page Two - Post Types and Image Sizes

In this part I'll go over creating your custom post type, setting up additional image sizes that we can take advantage of later and finally, adding your first image.

The art gallery will be controlled by the custom post types we can set up inside WordPress. We'll use the Custom Post Type UI plugin as well as a plugin for creating additional image sizes so we can manipulate the images in to sliders, lightbox-style popups and all sorts of good stuff.

Custom Post Type UI

First thing's first, we'll download the Custom Post Type UI plugin and install that. Jump in to your control panel and click on Plugins > Add New. Perform a search for Custom Post Types UI and install the plugin.

Custom Post Type UI

Once that's downloaded make sure you activate it. Now you'll see a "Custom Post Types" menu at the bottom of your control panel.

Hover over it and click on "Add New".

Fill in the Post Type fields as below:
Post Type Name: artwork
Label: Artwork
Singular Label: Artwork
Description: My artwork

Custom Post Type Settings

You can click on "Advanced Label Options" to customise your labels even further. This includes things like  menu names, edit names, search names and so on.

Click on "Advanced Option" and  make sure the following settings are met:
Public: True
Show UI: True
Capability Type: post
Supports: (Tick all)
Built-in Taxonomies: Tags

Advanced Settings

Click "Create Custom Post Type" and you're all set to start adding your artwork using custom post types.

Post type is ready for use

Additional Image Sizes

Before we start adding our gallery images though, we need to set up some additional image sizes. Hop in to plugins > add new and grab the additional image sizes (zui) plugin.

Once that's installed and activated you should notice an "image sizes" option under the media menu.

Image Sizes

We're going to set up two new image sizes using this plugin:

Name: Large Slider
Width: 960
Height: 380
Crop: Yes

Name: Gallery Thumbnail
Width: 295
Height: 160
Crop: Yes

Our two new image sizes

It recommends you generate new image sizes, which you can do if you've jumped the gun and added some images already. But if you're following this tutorial fresh you don't need to yet.

Adding your first image

Click on Artwork > Add new artwork to add your first piece of art to your gallery. You'll notice it's exactly the same as creating any other post, except all we really need to add is the title and a featured image.

Adding our new artwork

Hit the publish button and bask in your newly added piece of art. But wait.. how do you see it?

Good question! You can view your artwork by going to <yourwebsite>/?post_type=artwork

It's a bit cumbersome (and ugly!) for now, but we'll get to that later :)

Our lovely (ish) artwork as displayed on the TwentyEleven Template

Ready to move on to templating? Good, because I am! Hit the page 3 button below or click here if you're lazy.