You are currently viewing Adding Artists in WordPress as a Custom Post Type

Adding Artists in WordPress as a Custom Post Type

Out of the box WordPress knows about Pages and Posts, which is fine for many web sites, but what if you really wanted to added a new type of information, let’s say Artists? I have a new client that wanted to showcase dozens of musical Artists on their website, and I wanted to make it easy for them to add new Artists in a format that made sense to them. My approach was to create something called a Custom Post Type, and there’s a Plugin for doing that: Custom Post Type UI

Installing that Plugin and creating Artists, my new post type, it then shows up in the WordPress menu:

New Artists menu

The client had specific fields to show for each Artist, so I added a second Plugin for that task: Advanced Custom Fields. This Plugin is so popular that over 2,000,000 downloads have happened. I created a new Field Group, named it Artists, then began adding fields using Text, Taxonomy, Wysiwyg Editor and Groups. In WordPress these fields can be arranged in any order that makes sense when filling out a new Artist:

Advanced Custom Fields: A Field Group for Artists

When a WordPress user wants to add a new Artist, they start filling out the custom fields:

Filling out fields for an Artist

To display an Artist I created a new Theme file template called single-artists.php using PHP, HTML and CSS code. The final result viewed by a visitor to the site:

Summary

When your web site has a new type of information, like Artists, where you want every Artist page to have the same layout, with specific fields, then it makes sense to use a Custom Post Type. Using popular Plugins like Advanced Custom Fields and Custom Post Type UI make the work go quicker, and in this case there is custom coding required for defining how the Artist page looks. Clients like to hire me, so that I can do the Plugin installation, setup and coding, then they can quickly add their Artists, all without having to be a computer science major.

Leave a Reply