Courtney P.K.: Welcome, everyoneto today's session from Learn
WordPress. This is a fun onewe've got today. This is the
story of the Custom Post Typelost in a world of pages brought
to us by Alicia St. Rose.
And I am going to hand it off toher to get started on your
screen share.
Okay, all right. Take it away,Alicia
Alicia St. Rose: Share myscreen, I can tell you a little
bit about myself. Oh, mygoodness, hold on a minute.
All righty. I think I'm gonnahave to do that. Again. I'm
using stage manager on my Mac.And so sometimes it does really
interesting things. So theytried to share.
Okay, here we go.
All right. Can you see my, myscreen?
Courtney P.K.: Yes.
Alicia St. Rose: Oh, awesome. SoI'll just say a little bit about
myself.
Beyond what I said in thebeginning, just a little intro,
I
I am a storyteller, I like totell stories. And I find that
sometimes people get the gist ofsomething technical when it's an
actual story. And you canrelate. And sometimes when we
talk about technical things likecustom post types, and, and
other Block Editor and thingslike that, in WordPress, people
wrap their head around thistechnical aspect of it. But in
my line of work
What are you about? I'm newdirector takes the helm.
A grande flash blinded theprogram post for a moment and
there before it's an amazingsite, the giant golden plugin
with CPT UI and blazoned on itsfolder, a multitude of twinkling
sparks radiating around it. Youcalled boom the plugin. The
speechless program post finallyuttered. Yes. Can you help me
and the other program posed bytheir own world?
The CPT UI taking note of theword posts responded that are
hung up in the blog world thatyeah, that's no place for a self
respecting program. Your contentis too important to get buried
in the blog archive. Can youhelp? Well of course
I got sticky but sticky buttons
Oh, that's great.
So they said the relievedprogram. If you don't mind me
asking what are all thosetwinkling lights.
There are more perks to being aCustom Post Type, you
automatically get your ownprogram archive. Just like the
Blog World. Every time a programis added it gets added to this
archive
Oh my gosh, the end is actuallyjust the beginning. Because it's
time to free your custom posttypes from the worlds of pages.
Someone's clapping,
Courtney P.K.: Jean is clapping.
Alicia St. Rose: I just want toknow, people, you could come
clean. Where are they? What arethey? In your pages? Do y'all if
you everyone wants to like, ifyou have questions, that's fine,
too. But also if you if you wantto be honest and say that you do
have like maybe too many pagesand something some words need to
be created.
Courtney P.K.: We have a commentfrom John: Certified Fresh 100%
Rotten Tomatoes. I was on theedge of my seat the whole time.
Alicia St. Rose: You guys aregreat. I love you. I feel I have
to pass the favor out. Because
no one should have to sitthrough boring Tech Talk to the
person.
Courtney P.K.: Yeah, this is thefirst time I think that we've
ever had a storytime as one ofour sessions. So it's great.
Alicia St. Rose: There's alsoplenty of time to because I
didn't want to just be a storyand you wander off because a lot
of things were mentioned inthere the three plugins that I
was talking about. Maybe we cango into details about, you know,
when do you need to know youneed a Custom Post Type? You
know, and that would be beforeyou make the website.
Courtney P.K.: Jean has aquestion.
Alicia St. Rose: Should I stopsharing my screen?
Courtney P.K.: Oh, yeah, goahead.
Alicia St. Rose: And okay, okay.Okay. Okay.
Okay.
Courtney P.K.: We'll go intosome questions. So Jean asks, or
says, I'm making a page withlinks to forms. Each form is on
its own page. Would this be acandidate for posts?
Alicia St. Rose: Yeah. CustomPost Type? Yes, I've done it
already. I do it in a festivalwebsite. So the advantage of
having a Custom Post Type isthat I want to be open and
transparent. For years they werepages. And then I would always
have to go digging through thepages to find them. So they just
this year, I mean, it was lastyear, I think it might have been
just this year, I decided, well,I'm going to make a Custom Post
Type. And I'm going to embed theformidable form on each one of
those. And so now when I go intothe dashboard, I just go over to
applications or for that that'swhat I named by Custom Post
Type. And I go there and they'reall just listed there just
listed and I don't miss one andthere's the wrong date on it and
stuff. You know what I mean?That's why that's that world of
pages that your forms are lost.They need to go on the journey
but they can skip the blog part.That's why I put that in the
story. Most people head overthere. Don't do the blog.
Courtney P.K.: Yes Any otherquestions? Yeah, Jean says thank
you.
And one more comment fromMiguel: I have to pass this talk
over to my students when this ison WordPress.tv. Epic and very
explanatory.
Alicia St. Rose: Yeah, isn't itI mean, I've, I feel like,
there's like essence to all thethings that WordPress can do.
And when it gets too esoteric,people understand that they can
grasp it so easy. And then theycan do the technical stuff
later. Because what needs tohappen when you're planning a
website, or even if you getinherited, if you inherit a
website, is that there's thestrategy. That's the most
important thing. That's thedifference between a hot mess
and a really efficient, workableuser friendly website. So a lot
of this stuff would havehappened when you sat down with
your team, or you sat downbefore you made your website and
you asked yourself about yourown business. And you said,
Well, what I have services, morethan one, service more than one,
that's like already a post. Andwhen you realize that when
you're making a post type,you're now making an object that
can move around, and can havearguments in a loop. So now
we're gonna go a littletechnical, but now you
understand why we're going from.So when you do that loop that
the post is doing, that's theoriginal looper. But your Custom
Post Type does it too, there arearguments that you can put a
whole bunch of them. Andsometimes when you use something
like generate blocks, and thequery Loop block, and you see
all these weird things areasking you to to choose, those
are the arguments that you wouldhave written in code, like what
taxonomy are we going to show?Or what how many posts are we
going to show? Or what the likethe date on some of them? Are we
going to alphabetize them, youknow, things like that. And so
when you make as Custom PostType, it takes more of the
dynamic nature of a post than apage, a page is something that's
almost like a statue of the olddays, okay, it's never supposed
to move, it's contact can befloating around and be at the
top that at the bottom nextweek, you know what I mean? It's
gotta be there, they're there.So if you have pages like your
mission statement, or about andthings like that, then you want
to make that a page. But thenall of a sudden, now you're
starting with, we got thepresident, and then we have the
secretary. And then we have,there is an urge to make pages
for them. But isn't that thepeople who work there, like the
team. So now you got to thinkbeyond. And so now, what you
will do is you will make a teamand what their job position is a
category or taxonomy. So you'reable to do that kind of thing
with Custom Post Type, like,give groupings to stuff, you
can't do that with pages, and itgets really rough. gets rough
after a while. With 1000s ofpages.
Courtney P.K.: I could get tothat point. Miguel says, very
good points, strategy andmaximizing the possibilities of
WordPress structured features.Thank you.
Do we have any other questions,comments? Anything about Custom
Post Type so that we could uh,
Alicia St. Rose: yeah. Doesanybody want to see anything?
Like, we got time? Because I can
Courtney P.K.: Yeah, we havesome time
Alicia St. Rose: I can probablyspin up or spin up my Local or
something.
Courtney P.K.: Yeah.
Alicia St. Rose: If we want
Courtney P.K.: if you want.
Alicia St. Rose: Let me go intoit. Let me see we got
Courtney P.K.: Is it onlyavailable with a plugin? Asks
Robert.
Alicia St. Rose: Wait, whichone?
Courtney P.K.: Robert asks, Isit only available with a plugin?
Alicia St. Rose: Oh, no. Infact, that was painful for me to
actually tell you guys to use aplugin!
Oh, my gosh.
Courtney P.K.: Yeah. Jean asks,Can you show us your application
CPT?
Yeah, yeah. Both. Let me I thinkI've got a little playground
site in Whoa.
Alicia St. Rose: that now okay.
All right
cool we got like 30 minutes it'sgonna be fun. Alright, so the
stop. So I've got a Local asanybody
use local, it's free, I think WPEngine now is in charge of it.
So you can download this and youcan put up any sites and work on
them on your computer. So that'sreally a good thing. And I think
we've got this this WordCampexample site when I was doing
some anyone can go in and
Unknown: oh, okay, here we godashboard, the dashboard
territory. So, if we go to theplugins and get the
Alicia St. Rose: Let's see, Ishould just
tell my computer I don't have toworry about these updates. Okay,
so we're going to add new andwe're going to do the Custom
Post Type UI right.
There's a bunch of differentones. Um, oh, see, I have to
Alrighty see that's there on itand like they you can't use it
with all versions of WordPress.I like that.
That's something you do want tomake sure that you're keeping
your plugins up to date on yourlive sites especially this is
a site that is maybe I shouldn'thave opened this site.
Unknown: This is a site that isa local so it's not like there's
no threat for anyone coming inand hacking it. But if you're on
a live site and you have theteam plugins are not updated, I
would suggest that you go andupdate those let's find a
blueprint instead. Let's seewhat happens here
Oh, we
Alicia St. Rose: so this is notthe type of efficiency that I'm
like down with right now.
Unknown: So we gotta I mighthave to actually go to a real
website that I've worked on withthe clients and stuff but I
don't want to do though this isgoing to be a WordPress TV
because it's their their stuff.So let's see if I can go into
plugins here. Oh, okay. Okay,it's not letting me do that.
Alright, let's do somethingreally crazy. Let's do start
create a new site real quick youcan I can show you how quickly
you can do this. So this islocal and creating a new site
Alicia St. Rose: calling itLearn WordPress
continue you want to use theirpreferred thing because that's
you always want to develop kindof where WordPress is situated.
And okay, I'm gonna do admin
password because this is local,so you can do stuff like that
are there other people who aredeveloping in the house? Yeah,
yeah. And otherwise this couldbe boring.
Oh my goodness. Yeah.
Courtney P.K.: Sounds like wehave a few developers in here.
Alicia St. Rose: Oh, good, good.Good thing they're like to like
Unknown: Well, let me see thechat. I can like if I can look
at the chat while I'm waiting
so, while this is doing that,why don't I show you something?
Oh, wait, I can go in. Go
Oh my God, what did I put onthere?
I think I just slipped.
Alicia St. Rose: Does anybodyremember why I put in there help
me!
I'm looking for you guys forsome help here. I think I put
lowercase. today.
Courtney P.K.: Oh I don't know.I think it was obscured.
Alicia St. Rose: No, I didn't doobscure. I didn't make any.
Totally did not. So we canactually have this happen. There
we go today. So I didn't dothat. So remove that. I know, I
know. You guys saw me I wasusing the wrong password thing.
Not good. Okay. So now like overthe plugins, this was going to
now we're going to do something,we're going to have something
happen. And I put in custom
Custom Post Type UI Okay.
with and they give you examples.And so that you can have all of
those words in the right place.And then it's already the
If you want to
Okay, so we added a new one. Andthis is the edit. Okay, so if
you were to have more than one,you can use this drop down and
totally like scroll throughthem. And do I have a website
that has about 15 Custom PostType sets for a festival. And
they have stages and musiciansand all this different stuff.
There's no way that would workwith pages, there's no way there
would have been. Absolutely andeven they wouldn't tell anyone.
And so also when you're usingCustom Post Type another thing
about SEO and something calledschema.
So yeah, so this was cool. Andthen
Unknown: it was a very easy touse Zapier because we zapped the
musicians and other like theperformers who were more like
aerialist and stuff, they zappedto workspaces on third party
platforms. And I was able to dothat very easy by saying just
zap I'm going to use theformidable this form. And this
formidable has this amazingthing where you can target a
post type and actually publishit. So I'm we're not even
posting these, like peoplesubmit their application through
the formidable form. And theyhit submit and these are drafted
until the curator says it's agirl and then then come in and
publish it and of course rewritetheir bio. Okay, because they're
musicians, they're not authors.Okay. So some of them were given
a song lyrics for bios, it'skind of interesting. So anyway,
that is that's that that's whatthat's the magic. That's the
magic of having Custom PostType. And, and you could do
anything. It's like clayintegrates with so many
different things. So I hope Ianswered someone's question,
because I went all over theplace, because that's why I had
to tell that story.
Courtney P.K.: Yeah, just aquick little demo how how you
use it?
Alicia St. Rose: Oh, well, whatI show you is there's a plugin,
but this is what I do.
Courtney P.K.: Hmm. Yeah, Ozmentioned that she'd love a Zap
WP zoom session sometimes.
Alicia St. Rose: Oh.
Unknown: So this is how I do it.I make a plugin, which, oh, my
gosh, I saw some people heardthat and was quaking in their
boots. But all you need to do isgo find a declaration, slap it
in a file, make sure the file inthe folder have the same name,
you don't have to but it's bestpractice, then upload it as a
zip into your, your plugins, andthen turn it on, and then start
writing this put if you put thiscode in that the plugin just
putting that code in there, thenShazam, that's what I use so
that I can find the word andthen just replace. So it's way
faster than that plugin. That'swhy I do this. But if I showed
you this first, you would havebeen like, no. So I found this
code years ago, and I just keepusing it again. And again. You
know what I mean? So the code isnot scary. People think it is
but it's really not that scary.When you get your pieces that
worked. You keep them. So that'swhat that's how I do it. And
then that's the only part ofthat too.
Courtney P.K.: That's cool. Ozalso asked if there is a CPT
repository.
Alicia St. Rose: Okay, what doyou mean by that because you
like
Courtney P.K.: She says,obviously each CPT is specific
to each site, but seeing otherexamples could be helpful in
building.
Alicia St. Rose: Oh, yeah. Oh, Isee. I see what you're saying
like, well,
there's really, I mean, thesky's the limit. It's it's that.
So let's, let's, let's, let's wehow much time we got 15 minutes?
Who asked the question?
Courtney P.K.: Oz.
Alicia St. Rose: Oz? Yes. Okay.So do you must have an idea of
something like, even if it'sjust a vague idea. So if you're
working on a site, or youvisited a site, is there
something that you could thinkof? You just put it in the chat?
the teachers can be a CustomPost Type. And school districts
can be a Custom Post Type. Andthen you can use a plugin, like
advanced custom fields, whichhas an object connection
Unknown: field, and will show upwhere the teachers are, and will
show up where the schooldistricts are. And then you can
actually see, when you're on anedited School District, you can
see which teachers are connectedto it. And then when you're on
the teacher editing her, you cansee what school district she's
connected to in the admin. Butyou can also like, there's like
a plugin called by theme code.It's called theme code Pro. And
it's, it gives you the code thatyou would need for the advanced
custom fields, you're going toput it in a template. And so
what happens is, those thingsloop on the page as well,
because you've connected them.So there's, there's one way of
doing it, depending on if aschool district now would have
to have different categories forthe area it's at. You see, I'm
saying like, this is like awhole strategy. It's like,
everything is so organic, and soinfinite and could be like any
example, it's just tailor madefor you. There's no, there's no
like, one size fits five peoplekind of thing. It's really about
you being able to do exactlywhat you want, because you have
this ability to do this custompost types. So the teachers, if
you were going to use it as thedistrict as their category, then
that then there will be ataxonomy page, just like a
regular archive page shows upthe taxonomy page would be like
LA School District, and then allthe teachers who were had that
category will just show up onthat page. But it all depends on
what you're going to be doingwith the website and that
information. On the ground andon the site. Because I the
festival site that I'm workingwith. Yeah, the site's great.
But there's a whole bunch ofstuff happening that we had to
shoot stuff to the app going tolike things, something called
Podio. Not for long, but andthen we're like this is so many
things that happen. And so youit's an exploratory discovery
session that you need to havebefore you start making
something. And so anybody who'senterprise level that's using
WordPress, there is a team ofpeople doing this for them.
They're definitely using thisCustom Post Type thing.
Courtney P.K.: And Oz thanks youfor your insight.
Miguel asked about if it'spossible, find your code
templates anywhere.
Alicia St. Rose: Oh, yes. On theWordPress developer.
Do you guys have got to go thereyou got to go to, let me get in
here.
Custom Post Type code. We'reafter the first should be yeah,
here we go. Registering CustomPost Type.
See, we recommend that you putCustom Post Type to the plugin
rather than a theme series. Thereason why they're saying that
that's a plugin thing I toldyou, you turn your theme off,
change it to something else,Custom Post Type go away. So you
don't want to do that you wantto make this plugin. And so he
if you go here,
I do have the code, I use itover and over again. But that
there is definitely a danger oflike finding code, just putting
it somewhere you don't know whatit's doing with something else.
So, but the byte code works, itdoes. But I just want to
dissuade people from just doingthat. Because you got to know
what the code is doing. Is in ohmy gosh, it could be a
nightmare.
Courtney P.K.: Miguel alsomentioned generate WP, that your
your approach is very similar togenerate WP. Are you familiar
with that?
Alicia St. Rose: Oh, yeah,that's the one where you ask.
Unknown: You want to post titlethat generates the code for you.
And a bunch of other things,too. I think I've been there
before. Yeah. But the way I doit is because I just, I like I
have a plugin for the lucidityfestival. And there's like that
piece of code is in there. Andthere's a way of doing the code
without slapping it all in. Youcan actually do variables and
stuff and just change names, butI didn't do it. I was lazy. But
once you have like 17 of thosein the file, you gotta have
search and replace ESPYS onunique word. So it's Shazam.
That's a key. That's a tip byyour code. The word
Courtney P.K.: This was fun.Yeah, I
Unknown: I'm glad but like thestory went over. I was a little
nervous.
Courtney P.K.: Thank you. Yeah,it was really, really
insightful.
And I hope that everyone elselearned something new today. I
know I definitely did. Jeancomments, to you Alicia, meetups
with you are such fun, and yourenthusiasm is contagious.
Please
Alicia St. Rose: Please come tomy Meetup. Yeah, a lot of fun.
And it's not just me that makesit fun. There's a whole cadre of
like 10 people that we roamaround because the geek gang or
something. And we were wewelcome you to any of the
meetups that we're at. There'sthere's mine, which is the South
Central Coast Adventurer
WordPress Adventure group.There's one in Santa Cruz. My
friend Eagle does Eric liu Kurtdoes a whole bunch of them. Mike
Pilley in Bakersfield, there'sjust so many they're all online.
Oh much.
Courtney P.K.: Those names, Iknow all those names, they're
great folks.
Alicia St. Rose: Oh my gosh.Learn.
Courtney P.K.: Yeah, I've shareda link to your Meetup in the in
the chat.
And yeah, Could you could youstop sharing your screen for a
moment and we'll wrap up. Itlooks like we don't have any
more questions.
But if you do have any morequestions you can get in touch
folks can get in touch. I sharethe screen one more time. So
here's Alicia his contact infoon Twitter X, whatever you want
to call it these days.
Intrepid realist and her websiteis WP with heart.com.
Yes, and if you want to keep intouch with the train team and
with Learn WordPress, you canjoin the
WordPress slack atchat.wordpress.org and join the
Training Channel and that'swhere we do a lot of this work,
educational resources for thecommunity and if you're
interested in doing apresentation live to help you
get that started. And my contactinfo is here on Mastodon and
Linked In.
And we want to thank you all forlearning with us.
And thank you Alicia forstorytime and poking around on a
test site with us. This wasgreat. Thank you. Let's see if
we have any last minute thoughtshere. Yeah. Lots of gratitude
and chat. So yeah, thank youeveryone that you have joined us
today, and we'll get thisrecording up on WordPress TV
within the next day or so.Awesome.
Alicia St. Rose: Yeah, thankyou, everyone.