In this video we'll start organizing the cafe pro theme as if we're building it for a photographer with
customized WordPress with custom post types taxonomies and custom fields so that our client the photographer
can use the site to organize images in a specific way by planning how the site needs to arrange and
display the content in advance.
You'll have a roadmap for how to create your custom post-time by going through this process you'll see
how.
No matter what theme you are using WordPress can manage content however the client or web site visitor
needs it to be organized.
Let's start by taking a look at a test site I've made on my local development environment.
The W.P. of course to WordPress installation.
It's a Genesis site with the cafe theme which should look pretty familiar to you here but it's not on
our students sandbox area.
I've been playing with it in my local environment to show you how you can set up custom post types using
that custom press plug in as we go.
I'll be logging back in to the student sandbox area and going through the steps with you so that you
can experiment with the custom press custom pulls types plug in and configure the cafe pro theme as
you like.
We're going to be setting this up as if we're doing it for a photographer and as we scroll down on the
home page I've just added a series of widgets into the front page area right here front page 2 and one
of them I activated with an image and some copy and a link to a photo type.
I made a custom post type called photographs and I made a taxonomy called Photo types.
We're basically going to be categorizing the photographer's photographs into four different categories.
One of them is dogs and then we'll also be using people landscapes and still lifes as three more categories.
So I just clicked that button that led me to the category page or the custom post type page called dogs.
You can see that it's W.P. of course to slash photo underscore type and then slash.
Dogs and dogs is the name of the custom taxonomy.
That is one of the different taxonomies under photographs.
But if you look at the display page what I've got is a certain individual post which is one of the photographs
Post and The title is Bradley.
I've got a photograph of a dog some content here and you can see down on the left hand side.
It's filed under dogs.
This is the page we're looking at right now.
And on the right hand side it's tagged with a couple of tags.
So I've got three posts here so far each of them is clickable through the title or the link.
Just like a standard post inside of Wordpress and then I've got individual pages displayed with a full
width image as well as a footer that comes up with some data about the image itself.
Now these are using custom fields.
We haven't gone over custom fields very much but if you remember in a previous chapter in the author
pro theme there were some custom fields that the user could use to define different types of information
about the books or the place.
In this case we've got custom fields for the type of camera the type of lense and the date the photograph
was taken.
So that was just a small tour of how I've set up custom post types within the cafe pro theme using custom
press.
Now let's go back and start setting it up ourselves in the student's sandbox.
Go ahead and log into the student's sandbox.
Make sure you're in the cafe pro theme site that we've been working on and it'd be a good idea to open
up the live site inside of a second tab inside the student's sandbox in the cafe pro theme WordPress
dashboard.
Go ahead and open up plugins.
Scroll down just a little bit and find custom press and click activate.
Great now that that plug in is activated you'll see a toolbar item on the left hand side called Custom
press and it contains all the set up screens for setting up your custom prototypes as well as some global
settings for the plug in itself.
We won't be using it but it also enables you to import and export custom post types from site to site.
Another thing you'll notice is an additional menu item on the left side called photographs with some
menu items called add new tags and photo types.
Which is just like up in posts.
The posts button add new categories and tags.
If you look at photographs again we've got to add a new photograph.
This is our list of photograph posts.
We have a standard tags taxonomy and then a custom photo types taxonomy which is just like categories
for posts because I created this custom post type called photographs previous to you downloading your
new sandbox site when you activated the custom preste plugin.
All the data was already in the database from the 30 posts that I created and I connected 30 media images
as well with 4 different categories called Photo types in the categories of still life people.
Landscape and dogs go ahead and open up under photographs click photographs.
So we get a list of posts in our custom post type called photographs.
You'll see that there is 30 items and they're all titled and they have a little bit of information across
the top.
Follow along as I show you how I created this post type as well as some other items.
If you look under can custom press content types.
We've got a photograph post type as well as a taxonomies tab and custom fields that I'll be customizing
for you and I've already created it's already live inside of your sandbox site so if you have the custom
press content type screen open follow along as I show you how I created the custom post type the custom
taxonomy and the custom fields so click photograph and let's check out the editing post type screen
you can see that I've used photograph up here.
Now I'll cut to the footage where I created this post type itself.
So let's use the word photograph right here as the post typed.
And once you name it you can't change it if you needed to change the name of it.
You'd have to create a new post type for that.
It doesn't matter if you capitalize it or not.
It'll change it to all lowercase.
We're going to leave.
Title checked and we're going to register support for the editor.
That's the post editor so that we can add content to this custom post.
We're going to be using the featured image so we'll click thumbnail and will also allow an excerpt for
our new posts and then we can scroll down and leave the rest unchecked.
Now we are going to be making a custom post type like a category but let's assign regular taxonomies
categories and tags so that the theme will be able to display both of these and our custom ones as well
as we go down leave the default settings for capability type and leave make sure that map Medak capabilities
is checked as true and as we go down we're going to be choosing how WordPress displays the labels for
this custom post type.
So we have photographs usually plural for the name the singular name is going to be photograph and new
and add new item should be add new photograph.
And I'm just going to keep going down.
And I've done this before you can see that it's filling in the fields for me as I go.
There's a little bit of text gives you some a suggestion about what the default is and so you can define
it for your own post type name so it will be new photograph here view photograph if we want to search
photographs you can see that it's usually plural
no photographs found no photographs found in trash.
And we can see that it's not used on nonhierarchical types which is what this is.
But you can put parent photograph if you like won't actually be used.
And then the custom fields block photograph information as we go down the left hand column we can leave
the description blank for now we can choose where to put our menu item here on the left hand side.
I'm just going to place it here below.
Pages which is instructed down here can leave the icon blank and it will use the pin icon that's the
default icon for posts right here.
Pushpin.
So scroll back up and go down the right hand side we're pretty much leaving these to the default.
It'll be public so we leave that as true.
These aren't changeable right now since it's public will go down to the next election.
This isn't going to be a hierarchical post type.
But when we do go up and choose a taxonomy for it we're going to make a hierarchical taxonomy which
where we can have parents and child categories basically for these photographs if we need to.
So I'll leave this as false.
It has an archive.
True.
And I'd like it to be called photographs also.
I'll have the rewrite as true and just leave this as the default.
And in terms of eppi mask and endpoint mask this is more advanced but we can just leave none checked
leave query over there.
True.
And this export import.
True that's fine.
And then click Add post type and now by doing that I've created a post type called photograph and therefore
I can create posts that are photographed posts and now we can create a custom taxonomy for it.
Basically a category as well as a series of custom fields.
Let's click the next tab across Cobbe taxonomies and we're going to create a taxonomy for our custom
post type.
So click add taxonomy and we've got again a two column lay out of a whole bunch of different settings
for this custom taxonomy.
It's the same type of thing.
So use photo underscore type and we're going to make this available for the photograph.
Custom poster to only check photograph and then as we go down again we're going to use photo type usually
plural so we need this one to be photo types and the singular one is called photo type and knew would
be add new photo type and new photo type.
This is what it will say when we want to edit the photo type update photo type search photo types.
Usually it's a plural.
This one will be popular photo types.
This one is all photo types.
It's with the parent photo type and with a colon this will be parent photo type with a colon add or
remove.
Now this isn't used on hierarchical taxonomies.
We are going to define this taxonomy as a hierarchical one so I'm leaving this one blank this one isn't
used on hierarchical taxonomy so I'm leaving separate items blank.
And I'm also leaving choose for most used blank because this is going to be a hierarchical taxonomy
basically similar to categories.
Almost finished.
Now we can click true for show admen column.
This lets us show the different types of columns inside of the admin area.
It'll show us information about each of our taxonomies if we like.
We want to leave it public and then these are just automatically selected for us.
This is important under hierarchical.
We're going to make this true so that our custom taxonomy here is like category's not like tags so we
can leave the rest the same as the default rewrite it needs to be true.
The mask can be none.
And then add taxonomy type
one more setting inside of custom fields.
We're going to add a custom field for our post type.
Now we'll just create three different custom fields one for the type of camera.
And I found using this plug in.
It's nice to have a colon at the end of the title because the display is a little bit easier.
So if we look over at my example here remember in our single post if we scroll down it shows some image
data so camer a colon and then whatever the photographer filled in inside the puts and then lands and
then what type of lens and we're going to set up those custom fields right now inside of your student
Sandboxie.
So use camera Colan it doesn't necessarily have to be required.
I think I did require the type of camera but then leave the lens and the date open and leave the default
for these now this one I've used a radio button with two different cameras so you can put anything you
want in here really.
But I put two different cameras that I own and I'll add another option called iPhone 6.
So two types of cameras one or the other makes it easy for the user to choose from the two.
And we're going to be using this custom field in one of our post types and it's the photograph posts
type and then scroll down and add that custom field.
And now we're going to do two more and we're done.
So now we'll do lens.
Colin we can make that non required because obviously if you're going to use the iPhone you might not
put a lens I don't want to make that required.
We can leave it as a text box or they can fill in whatever lens and we need to then add it to this post
type.
And that's our last step
last one.
Just in case the person is adding a bunch of photographs into their web site and it's all on a certain
date you don't want to have to go and change the date of the post but will have a specific date taken
field so that the photograph was taken on a certain date.
And in this way we can use any of these elections.
And let's experiment with the date picker.
And so this is good.
You can go and choose the way that you want to have the date formatted for you.
For us it's usually like this in the USA.
So I select that one and go down and select for this custom post type again and click add custom field
in this video.
You've followed along with the set up steps for creating a certain custom post type called photographs
using the custom press plugin since you activated the plug in however I've populated your sandbox site
with the content and images you need and your custom post photographs is already fleshed out with your
content.
That way you won't have to create each of the posts yourself in the next video.
You'll start by creating a few new posts for your custom post type then you'll customize the display
of the new content inside the cafe pro theme.
Let's do it.