Hi there, welcome to Untangling Templates. My name is Kathryn Presner and I've
been working with WordPress for a very long time for the last over 10 years as
a Happiness Engineer with WordPress.com and I'm now working with the training
team as part of Five for the Future sponsored by Automattic. I'm here with
Ariel Maidana who has co-developed this workshop with me and who is also a
Happiness Engineer on WordPress.com. So WordPress 6.5 has been delayed and it
will be out now a little bit later than when this workshop is taking place. So I
will be simulating what 6.5 will look like with the Gutenberg plugin and
WordPress 6.4. So some of the things you might see here if you're still running
6.4 might not be present so just to keep that clear. Alright let us look at
what we are going to cover in this workshop. First we're going to go over
some definitions that will be helpful in talking about templates. We're going to
look at web page anatomy, different parts of the page. We're going to look at
different kinds of templates that come with WordPress and with a specific theme.
We are going to edit an existing template and see how that works. We're
also going to look at how to add a new template type. Then we're going to look at
how and when and why you should add a custom template. We're going to look at
different ways to manage all of your templates. We're going to go over some
blocks not to remove or at least to be really careful when removing to make
sure it's something you really want to be doing. And finally we're going to have
a good section for questions and answers. And we're going to start with what is a
theme. So you might already know but a theme is the underlying framework that
defines the overall style and look of your WordPress site. And it's pretty
crucial. Why? Because all WordPress sites must have an active theme. Sometimes
people say I want sort of a really blank slate. I don't want a theme. Can I remove
it? The answer is no. All WordPress sites must have an active theme. And WordPress
themes are diverse. They each have unique features and defaults and they allow you
to customize the site's look and feel. And the level of customization you can do
sometimes depends on the theme type. So we're going to look at the two basic
types of themes. The first type is a classic theme. This is 2021 and I don't
know if anyone knows what's special about 2021. If you do put it in the chat.
2021 was the last classic default theme. And what is a default? What is a classic
theme? It's a theme that does not use the site editor to design your site. So this
is the standard type of theme that existed before the site editor was
developed. We're going to look at the site editor shortly of course. And on the
right you'll see an image of what is that tool. Do you recognize it? It's the
customizer. And this was the way that you would do things like add a site logo or
set up menus or widgets. And this is the way that you in a classic theme would
customize your site. And it was kind of limited. You could set up your menu
and change the order of menu items but you couldn't move the actual menu to
different parts of your page in most cases. You could add a logo as you see
here. But for example in 2021 your logo is always going to be centered at the
top of your page. So it was much more difficult also to create new layouts. For
example in a classic theme let's say you wanted to add a sidebar to your blog if
there wasn't one already. That was pretty complicated to do in a classic theme.
You'd have to get into probably creating a child theme. You'd have to get into
creating a new template. You'd have to know some PHP code and various things
like that. So classic themes were it made it much more complicated to customize
your theme. So what's the second type of theme? It's a block theme. And what is a
block theme? Well it's a newer type of theme and it uses the site editor to
design the layout and style of all the parts of your site. So you could design
your home page. You could set up what individual posts would look like. Static
pages etc. This is 2024 the latest default theme which is a block theme.
And it lets you also do very handy things like set up a header area with a
logo wherever you want it or your menu wherever you want it. And that would be
can be consistent across your whole site. So unlike with a classic theme you're
not locked into specific layouts that the theme designer has specified for you.
You have a lot more flexibility to move things around. All right. You might also
hear the term full site editing or FSE. That's an older term and it means site
editing or FSE themes. If you hear that it means block theme. But the generally
accepted term these days is block theme rather than FSE theme. But it's the same
thing. As I'm speaking thank you Ariel. Ariel will be putting links into the
chat. I will also post these links when the recording is posted on WordPress.tv
so you can have them there if you don't feel like copy pasting them out as we go.
All right. Another term I want to define is a pattern. And we're going to look at
where these are in the editor in a moment. But patterns are basically a
feature that come with the site editor and they are pre-designed groups of
blocks that form a layout. So it's sort of like a chunk of a page or it could even
be a whole page designed by somebody else. You can also create your own
patterns. And you can find patterns in the site editor. You can also find
patterns in the page editor and the post editor. So these are patterns also called
block patterns. And there's different sections of them you can find about page
patterns or footer patterns things like that. Now you're here for templates. So
finally what is a template? A template sets up the structure and the design of
different parts of your site. For example this is something called a front page
template. And a front page template is automatically applied to your site's
front page. And for example you might have the header at the top that's the
area in red, your content in the middle, your footer at the bottom, and it's laid
out in a specific way. Here on the other hand is a single post template. This
automatically drives the look and feel of every individual blog post. So it works
by pulling dynamically in the content from your posts and displaying it like
this. So the area in your posts editor is here in the content editor and the
header and the footer is the same on every single post. So you might have your
your date, your author name, a featured image, etc. And you can design this
however you want. So you know for some templates they are automatically
applied to the dynamic part of your site that is being generated by WordPress. So
for example this is a page 404 template and it's automatically applied to a page
not found. So if someone types in a bad URL or reaches a dead link this template
will be driving the look and feel of that page. This is a real advancement
because you know to edit your 404 page template in the past you had to open the
file, edit it, upload it to your theme, make sure it's in a child theme, otherwise
you're gonna lose all your changes. So this is so much easier than it used to be.
I find this amazing. Alright let's go into the demo part now. This is I
love interaction because I think you know screenshots are great but actually
looking at the site and looking at things together is another thing entirely.
Okay so here's our demo site and you might recognize this as being 2024, the
default theme that we talked about. We have some dummy content, this is food
connection, we've got our our homepage here with some static content and then
we've got our blog post down here and we've got an about page and we've got a
contact page. This is what our demo site looks like. We've got our header up here,
logo, etc. navigation bar, our footer down here. Alright so we're gonna go into the
dashboard. So if you've never seen the site editor before it's under appearance
and do you notice what's missing here that you might have expected to see with
a classic theme? What's the tool here? Customizer, there's no customizer here so
you do see editor. So we're gonna go into the editor.
Alright now we're in the site editor and this is the section which shows us
different things we can customize in the site editor. We're gonna go into templates
because that's the focus here. Now if you are have not yet updated to you know the
beta versions of 6.5 or you're not running Gutenberg plugin this might be
new to you. We've got two sections of templates here. We've got the default
templates up here and we've got a section called custom. So default templates
are templates that come with WordPress core and I'm going to go through some of
these and then we've got custom templates. These are templates that are
defined by the theme so in this case they're defined by 2024. 2024 for example
offers a page with a sidebar. So let's say you want to have certain pages with
a sidebar you have that here in 2024. It's a custom template because this isn't
something you're going to find in every theme or a page with no title. Let's say
you want some pages have no title you can use this template for that. Now up
here we've got the default templates so I'm going to go through some of them and
explain what they are. I'm going to click on all archives and you'll notice this is
in alphabetical order. Click on all archives so one thing I want to point out
is that you've got the definition of the template up here at the top left. So if
you're ever not sure what a template does what one of the core default
templates does you can read the blurb here. So all archives says that it
displays any archive including posts by a single author which is also called the
author archive, categories, tags, etc. So it also serves as a fallback when a more
specific template cannot be found. So WordPress has sort of this waterfall
meaning that WordPress looks and sees is there a specific template to display
categories? If so use that. If not fall back to the next you know the next one
and the next one would be all archives. So you can see here on the right that you
know it displays in a grid by default and we've got our pagination at the
bottom, featured image, etc.
All right we'll open this in the editor so I just clicked right in by the way so
there's two ways to edit the template. You can click right on the right in the
preview area or you can click this little pencil icon here that says edit
both will do the same thing. I always recommend opening the list view that's
these three little lines here and opening some of these to better see how
the page is put together. So this is list view and once you open these you can see
the blocks that make up each of these templates. So if you can click on one you
can see oh this is a featured image you can also look over here on the right and
see. And so of course you can edit this as you can with any other page in the
editor you can edit this so if you want to change how this is arranged you can
do that. So that is really amazing because again this would have required
editing a PHP file. It looks like someone's having trouble seeing my screen
and so maybe Ariel can do a little bit of troubleshooting with you directly
because I think probably others would have mentioned that you cannot see my
screen. I'm assuming everyone can see my screen. So I'm going to keep going through
and hopefully you can get that sorted. So I'm going to go back. Okay everyone else
can see my screen. Great thank you. Small moment of panic. I think I think
somebody would have told me before. So going back down the list we've got the
blog home. The blog home you can think of as your posts page so this is the page
which is set as the posts page under settings and reading and you know you can
add other stuff to it. So here the blog page is set as the home page and we've
got our posts down here and we'll keep going down. Category archives. So this is
a template that I made. 2024 does not include this by default. I made this
earlier and it is what displays the categories. Category archives. Index. Index
tells you here it's a fallback for all pages and posts when a more specific
template is not defined. So let's say you install a plugin that displays posts in
certain ways but it didn't include a template for that. It'll fall back to
index usually. We've got our 404 template. We looked at that in the
screenshot before so page not found. Here it is and again if I click into it you
can see that you can edit this. So you can say oops page not found and then
you can save it up at the top right and it tells you what template is being
saved. 404 are you sure? You say yes and that's it. We've just edited it.
Pages is a very important template. Pages as it says here displays all your
static pages unless you've overridden this for a specific page. So we can see
here on the right we've got I'm going to open this up. We've got our title here.
We've got a spacer. Got our featured image and then we've got our content
which is very important. All right we'll get back to this a little later
explaining why this is locked. Just going to keep going through the rest.
Search results pages again this was challenging to edit in pre you know in
classic theme days. Now you can just edit it. Let's say you don't want a search
box. You can just remove, delete that and save it. You can do whatever you want.
It's just so amazing to me. Single posts is for individual blog posts.
If you remember classic theme days this is the equivalent of single.php back in
classic themes. Those are all the default templates. All right now if you
scroll down here you'll see something that says manage all templates and I
want to show you a little bit about how to use this view. This shows you all the
templates mixed together. Both the default ones and the custom ones. It
doesn't tell you which are which in this view but the ones that came with
2024 don't have a description so that's how you can tell or the ones that are
specific to 2024 rather. You can do a couple of things. You can search.
Let's say you want to look for the single template but you don't want to
scroll all the way down. You can type that in and you can find anything with
the word single in it. You can do a bulk edit. Let's say you want to so this is
you know similar to bulk edit in WP admin. You can click and right now the only
option to bulk edit is delete or reset. Delete means you know you if you want to
delete a template that you created. Now notice that some of these say author
2024. These are the ones that came with the theme and some of them have my name.
So remember I mentioned I created category archives template earlier. You
can only delete templates that you created. You cannot delete templates that
came with a theme. Okay so that's sort of something built in to prevent you from
you know getting rid of a necessary template. So I could delete the I could
bulk delete the one that I created. You can also there's a couple of other
actions here. If you click the three dots this is a new feature with 6.5 or if
you're running the latest Gutenberg there are now there is now a revision history
in the templates and this is this is amazing because it allows you to let's
see what happens. I'm going to click here view revisions just like with posts and
pages it allows you to see your revision history. All right so this is a bunch of
code you know like other revisions stuff that was removed is in red stuff that was
added as in green added or changed so and you can restore. So this is again a
new feature it's really cool. It's also when I click that button to return it
brought me to the template itself you can see that the revision history is also
here right on the right on the template so you have access to it from a number
of places. I'm going to go back here just go back to manage all templates. So yeah
I think this is all that I wanted to show you here. Before we leave this
though I do want to show you options so this little settings area here or
options area here if you click on it there are a couple of these are new to
six point five you can now view templates as a grid so if you are more
visual and you want to have a little preview of what they look like you can
use the this view again you can delete from here and you can edit items in bulk
this way so you want to edit two items you can delete reset reset by the way is
what previously was called clear customization so if you were looking for
the what is in six point four called clear customizations it is now called
reset so a little tricky but now that you know that hopefully that'll be
helpful what else so again under the options menu you can sort I'm just go
back to table view you can sort by author so if you want to see all the ones
that came that I created grouped up at the top you can sort it that way you can
remove fields let's say you don't want to see the author now the author is gone
and you can let's say you have a ton of templates you can view more of them per
page or less of them per page all right okay so the different ways to manage
your templates here also just want to quickly mention template parts so in a
template the chunks that are in purple header and footer in this case our
template parts and they are sort of subsections of a template that can be
applied in multiple templates and those now live under patterns so if you're
looking for them I think this was moved previously but just just if you've
never seen this before they're under patterns manage all template parts so
they're here okay if you're looking for them all right let me just see if there
are any questions and Ariel's taking care of this okay let us continue so now
we've looked at the different types of templates we're gonna look at editing an
existing template which I kind of did really quickly before but we'll look we'll
go into more detail now so let us go into templates pages so again I'm going to
click right into it this drives the display and look and feel of static
pages okay I'm gonna open the really important part is this middle block here
this middle group block so I'm I promised you that I would talk a little
bit about this lock icon here and why it's so important so what have we got on
a page and I want to I want to go to we'll go to the about page for this you
see we have the header we've got the title and then we've got our content
which consists of some paragraphs and pictures go back to our template you'll
see that all that is being pulled out of here we've got our title if the post had
a featured image it would be displayed next this post is there sorry page this
page does not have a featured image so there is not one directly below the
title but then you know there's all our content now it's locked because it's a
very important block as you can as you can probably guess if I were to unlock
this first of all there's two types of locks a movement lock and a removal lock
so you can prevent it from being moved around or you can prevent it from being
deleted or both I'm gonna uncheck prevent removal and apply you'll notice
the lock goes away it shows that it's unlocked and I'm being very cavalier
here on me like I don't need this I'm going to delete it well notice you are
going to be warned when you when you are trying to delete a block that you
probably don't want to be removing so it says deleting this block will stop your
post or page content from displaying on this template it is not recommended so
you know there are these you know there are these warnings built in to try and
really discourage you from doing doing this but let's say I don't care I pretty
sure I want to remove it I want to delete it and I even want to go ahead
and save it what do you think's going to happen does anyone want to type in the
chat or just think to yourself in your head if I refresh this page what do you
think we're going to see let's see if you're right refresh
our contents gone right our contents gone why is our content gone because we
remove the content block and it's going to be the same on the contact us page as
well all right now the home page is different the home page is using the
blog home template so it's still going to be there but the pages that are using
the pages template contents gone so a couple things we can do here we can there
are no revisions showing it because it's only you need two or more revisions to
be able to have a revision history I it does not sound super logical to me but
that's the way it is technically so that's why it's not there however you
can use the undo button all right undo up here undo and here's our content
block back and we go undo again and undo again let's see if it put the lock back
but yes it did all right so you could you could have always put this back
manually by saying you know clicking this little three dots and going add after
insert but since we just done it I just did undo so I'm going to save it again
and so the moral of the story is watch out when removing the content block nine
times out of ten you are you shouldn't be into leading it all right okay so what
else let us go into the archives template and there's another block that
typically shouldn't be removed okay so all archives click into it I'm going to
open the list view and open up these blocks so this is the other block that
often should not be removed interestingly this one is not locked I'm
not sure why it probably should be you can lock it if you want but it is
driving the let's go back to the home page I'm going to go to a blog post down
here and I'm gonna go to a tag archive let's say wine all right this is the tag
archive for any post tagged wine let's say we remove the query loop block again
we do get a warning so it's not locked but we do get a warning if you remove it
and save it and refresh the tag archive again contents gone why because the
query loop block outputs the blog posts in this archive if we've removed it there
are no more blog posts to be displayed now if we go and look at the category
instead of the tag archive it's still here and the reason it's still here does
anyone know why looking at the templates the reason that the category archives
are still showing is that I created a separate category archives remember I
talked about the waterfall if the more specific template exists which it does
in this case the category template it will be applied if not it'll fall back to
the archives template since the category archives does exist that's what's
outputting this and that is why it's still displaying things because we did
not remove the query block from the category archives template I hope that
is clear let us go back and put that back all right so that's back another
thing I want to show just very quickly this is this is a new feature there
there's a little toggle here or not a toggle but two little tabs you've got
block settings if you're if you've got a block selected and we've got template
information so when you're in the template you can see the same
description explaining what the template does here and we have this transform
into now this is this is new if you want to have a different look it'll apply a
different pattern so right now we have a grid like this let's say we want a list
like this click that bingo we have a different look so this transform into is
a way to quickly apply a predefined pattern so that's that's super cool so
let's save that all right now we have a revision history so again this is another
way we've got two revisions now so we can click on this if we want to go back
and revert forward go back to a revision we can do that in that way all right
another tip I want to give you is that you can make multiple edits to a
template and not save them until you're ready so I've just made one change here
I've toggled off the archive type I'm gonna go back it reminds us wait we
haven't we haven't saved it okay but I don't want to save yet again it's
prompting us review one change but I don't want to save it yet I want to go
into single I want to put an exclamation mark I'm gonna go back now it tells us
we have two changes so it's kind of an interesting thing where you can review
all your template changes at once and see so I just click this button at the
bottom left it says there's two site changes waiting to be saved and it
reminds you what you've done you've made a change to all archives you've made a
change to in this case a template part because we added something next to the
category which is part of a template part called post meta and we can save
them all at once so that's kind of neat all right so that's some changes and
things you can do in existing templates let's now look up at how to create a new
template type so let us go back into templates again just as a quick recap
these are you know core templates or default templates from WordPress that
this theme comes with or that we have added in the case of category archives
and there are custom templates that 2024 came with to add a new template we can
do it from right from here we can also do it from manage all templates add new
template when you click on add new template you can see some different
types of pages you can add a front page template a front page template and I
noticed there was a question about a front page template front page template
will override anything else you have set on the front page so if you create a
front page template and put some content in there that's what will be
displayed it's the equivalent again if you're used to classic themes it's the
equivalent of front - page page P I believe there's a dash in there it's
the equivalent of that it overrides any other template you can create specific
archives template for date archives so for example your monthly archives or
yearly archives you can create a template to apply to a single post but
in this case I want to show you an example of an author archives template
and again these are this is a fallback template so we're going to create a
template for all authors and we're going to choose this one it gives us the
option to choose a pattern which sort of jump starts the creation of our template
so we're not starting from a blank site editor or you can skip this if you do
want to start from blank site editor and do it from scratch we're going to choose
this one here and again so just to drive this point home oh actually you know what
I had removed I had previously removed the author's name from this let me
quickly add that back well actually hang on one second let me just do something
sorry about this I had made this change I'm going to add the author's name here
I'm going to go add after and I'm going to type author name okay I'm adding
author name there okay and refresh okay so pretend the word by is there and this
is not clickable hang on one second so there's a there's a setting on the
author name to link to the author archive and the author archive is where
we're going to see our author archive template okay sorry about that so now I'm
going to refresh so now you can see that this is clickable so empty template okay
we're we are in a sort of liminal state here I've created the author archive but
I haven't saved it yet so just pretend we didn't see that okay so we've got the
author archive template here but I haven't saved it yet I want to add right
after this I want to add the author bio and the author biography is pulled from
the user profile I'm going to save this save it and now when we click my name
hopefully yeah so we created an author archive this is the display of my author
archive so it's all the posts that I have written it's got my bio here I left
templates so much that it's hard to contain my excitement I'm not being
sarcastic I do love templates so and that is that is coming from users profile
down here bio okay so that's it's pulling it in from there but let's say we didn't
want that template let's say there was no author template existing I'm gonna go
here I'm gonna go manage all templates let's delete it all right delete it so
the point I want to make here so we're deleting the template I just made I'm
gonna refresh we revert back to the archives template so just because there
isn't a specific author template it doesn't mean the author archives won't be
displayed it's displayed but it's using the default all archives template instead
all right which looks like this which looks like this and the difference is
that it doesn't have the bio okay so what else okay we're going to move on to
custom template and then we're gonna do Q&A so custom template let us go back
to manage all templates add a new template so you'll notice that down here
we have the option for custom template so when wait might we need a custom
template let's say we have a landing page or something we want to display in a
special way on the site first thing to do let's say I have a landing page and I
don't want the landing page to have a header and footer I want to link to it
from social media I don't want people to be distracted by navigating to other
parts of my site the first thing to do is to look through your templates and
see if a template already exists that meets your needs okay so you don't want
to duplicate stuff that is unnecessary so I'm gonna you know look for it's
often called a blank template I typed in the word blank up here I don't see
anything so again what did 2024 come with it came with a page with no title
page with a sidebar a wide image sidebar again this is not what we want we want a
page with nothing on it really except our content so we're gonna add a new
template we're gonna go for a custom template and we're gonna call it
landing page all right I'm gonna create it and there's two ways we can do this
we can we can start with a blank slate and add stuff or we can start with a
pattern and remove stuff I'm gonna go with the pattern way okay but you can do
either click the pattern I'm gonna open the list view right away I don't want a
header and I don't want a footer so I'm gonna click the three dots next to header
here delete click the footer click the three dots you can click the three dots
either here or here both do the same and delete I don't want a featured image I
don't even want a title I don't even want any of this I'm gonna remove this
whole group and delete and actually I'm gonna undo I do want a spacer because
it's a little tight to the top of the page otherwise I'm gonna remove this I'm
going to leave that big spacer and remove that one this is what I want this
is gonna be my landing page template I just basically want a little bit of
space and then the content on my page and I'm gonna save it all right that's
as simple as it is this this would have taken a lot longer in the classic theme
days and you would have had to to edit code now where's this page that I want to
apply the custom template to let's go into pages you'll notice that there is a
page announcing a mobile app I'm gonna open it up I previously created this
page rather Ariel previously created this page it is encouraging people to
download this app explain the app now interestingly it already says landing
page this is because I think earlier it had the landing page on it we removed it
pretend it didn't have that let's let's say normally you'd come in having never
create a landing page template before and the pen template is pages it is by
default using the pages template because it is a page but we can change that
let's preview what this looks like so what it looks like by default is this
all right it has our header then it has our content and then it has our footer I
noticed one thing right away which is that I am going to want the the title
but we'll show you how to change this in a second okay so we want to get rid of
the header and footer so we're going to apply the landing page template we just
made so I'm gonna click on this I'm going to say swap template and notice
there are a few things you can do from here you can go directly to the pages
template and edit it you can even create a new template right from here which I
don't recommend because there's a few little gotchas so I would avoid creating
a new template from here and you can preview the template I want to swap the
template and notice it allows us to choose from four different templates the
three that came with 2024 page with sidebar page no title page with white
image the three that came with 24 that 24 that can be applied to pages there was
one other but that's only for posts and the first one here landing page this is
the one I just made I'm gonna apply it now it says landing page I'm gonna update
it and you can probably guess what's gonna happen what are we gonna lose here
refresh we lost our heading our header our footer and our title so I
misremembered something we're gonna go back and we're gonna go back into the
editor we're gonna go back into templates we're gonna go back to our
landing page we're going to edit it and we're going to say add before I'm
actually I'm gonna do this in the list view I want this to be the title block
now we get into a little bit of padding issue but pretend this is aligned
pretend this is aligned with the content you know it's all the way to the left
we'll fix that later but this is how to apply the template to the page and we
probably want to go back and and make sure we get that green going behind or
maybe we want a different thing behind but that that gets into styles
backgrounds sorry anyway let's clear that I don't want to get a sidetracked
okay but that's basically how to apply the template to the page one thing to
keep in mind when you switch themes if you switch themes you lose your custom
templates because remember we said these are templates that either came with a
theme or that I created they're specific to this theme so just watch out if you
switch themes you'll lose your templates but you won't lose your page and post
content so that's one that's one reason some somebody you know asked why
wouldn't you put the if this is my landing page why wouldn't I put all this
content in the landing page template just put it inside there well you could
but you'll run into a couple of issues one is if you switch your theme you will
lose all your content because it was not in your page editor it was in your site
editor and the other is what if you want to create a second landing page or a
third landing page you have content there if it's empty like this with the
content block you can apply it to as many landing pages as you like so I think
this is more flexible and less risky and more portable so and the other thing to
note is that this template and I think I showed you this before that template goes
into the list of templates here and if you go my landing page if you go into
manage all templates it is here as well with my name okay now let us go to just
to summarize a couple of important things to remember that in block themes
you use templates to customize the look and feel of various parts of your site
and before creating a new template make sure you check to see does your theme
already come with a template that you that you could use instead before
creating one and be careful because in most cases you should not remove the
content block or your query loop block there might be situations where it does
make sense but in most cases these are the blocks that pull in dynamically
generated content from places like your posts and pages area so if you remove
them you will be removing content that you probably don't want to remove Ariel
just made a really good point in the chat and I'm gonna say it out loud so that
you can all hear it and when you watch this recording if you switch themes you
will lose custom templates but if you reactivate the same thing the templates
will come back so this is an excellent point if you if you forget you switch
themes you and you lose your your some content or your if you lose some content
or your template and you want to get it back you can switch back to the previous
theme and you will get back that content so all right I think that is it and we
have sped through this I hope it wasn't too fast Ariel is going to paste in a
whole bunch of links so you can grab them in the chat again I'll post these
in the meetup event as well as on the WordPress.tv post when it comes in when
it gets posted and now we will move on to Q&A I see a question from Ed so Ed I'm
gonna read your question and then hopefully answer it is there a reason
why we can't duplicate custom templates sometimes I want to have a new template
with a minor change from an existing one I have to create a new template then go
back and copy out all the elements from the template I want to duplicate which
can be time-consuming I agree it would be amazing to have a duplicate option
here and I'm guessing that's on the radar I don't know for a fact but it
would make perfect sense that once the very basic things like deleting and
revisions you know and resetting have been added which they will be in 6.5
that they will look at the devs will look at adding a duplicate template
option because I think that's an excellent idea and I don't see why we
shouldn't have it Barry says I how can I add PHP to a template I'd like to add
PHP to automatically update the copyright year but I don't want to rely
on another plugin I think you're for security reasons I don't know if you're
allowed to add PHP code without a plugin to it to anything in WordPress in the
in the editor it's a good question I know that there were plugins that would
allow you to add snippets of PHP back in the classic theme era and you could do
that in a widget you know widget to add PHP I don't think that's a thing yet in
the site editor I could be wrong I've never heard of that but for security
reasons it's you know allowing people to add chunks of PHP it's not super great
idea but I understand the use case and I totally agree it would be nice to have
an updatable copyright year Oh Carla hi Carla has an excellent question when you
export a site our custom templates exported as well yes this is a super
cool thing and I'm so glad you asked that because I wanted to mention it and
I forgot when you go to tools export and when you export all content it
now exports your templates so that's amazing because you know I had to move
this site from one install to another and I wasn't sure if the templates would
come with but they did so it was fantastic it's a really really handy it
doesn't specify that here but but it does now thank you Ariel for pasting in
all those links Oh Laura has added that for now you can if you want to duplicate
a template you can copy paste the blocks from one template into a new template
yes that is the way to do it and I think Ed that's what you've been doing yeah
it's it's as I like to say better than a kick in the pants but not the ideal
method for sure Barry has a question I see that 2024 offers different custom
styles for the website can I add or change custom universal styles okay
that's a great question not really a template question but yes that is more
in the styles area so in the sorry I'm just kind of going quickly here in the
editor if you click styles it comes with these are called style variations is the
name for these and if you click the pencil you get a little welcome to
styles and in this panel on the right which you can also access when in the
site editor by clicking this little icon here you can edit these I do not think
you can add your own style variations without touching some code I could be
wrong on that but I think for style variations those are in the file called
theme dot JSON so that's more of a code thing but you can modify these so you
can you know you can let's say you're not crazy about this specific shade of
gray for the captions or you know charcoal for the buttons you can change
that which is really cool it's just that you have to do it this way oh Laura
excellent Lord just recorded a lesson about global styles which should come out
next week thank you Laura that's amazing there are lessons and tutorials about
just about everything or lots of things so that's that's awesome thank you what
else oh interesting and says to get a copyright year you have to create a
block so a custom block and there's actually a tutorial on that subject on
WordPress TV fantastic I did not know that so you can check that out look go to
WordPress TV and look for that tutorial awesome so Jennifer says so we can't
copy the custom template to a cloud library to share between sites I don't
think you can do something like that right now you would have to export the
the templates and import it into another site I don't think there's something
like you can have a template live in the cloud and share it that sounds like a
great idea again maybe that's something in the future that will be possible
all right
okay flurry of questions I think we've answered them all are is there and we
have nine more minutes isn't that amazing oh Laura says cadence has a cloud to
share pages etc okay that's interesting I don't know if there is a thing a way to
do that with templates yet you know the site editor is still relatively new so
it's in very active development and some things are still I call them you know in
their infancy and so you know the other thing I want to say is that you know
even even things like the reset icon things are changing rapidly is what I'm
saying so new features might be added if you want to experiment with Gutenberg a
plug-in on a test site you can see what's coming for example you know right
now the reset icon and the revisions icon look the same which I think is not
great because it means you can accidentally do one instead of the other
and so there's an issue on github to to make them different to avoid confusion
that's an example of something that probably won't be changed before 6.5 but
is being worked on actively so if you do run Gutenberg again on a test site
probably you'll see that there oh thank you Matt for the copy copyright block
tutorial that is awesome I am going to actually save this whole chat so that I
can pay some of these links in the in the in the event when I paste them in
because there's some extremely useful stuff here somebody asked if I teach
weekly I will I will now be teaching monthly actually something I wanted to
point out is that I will be repeating this workshop if you arrived late or if
you just want to attend again I'll be doing this again next month at the end
of April and so different monthly workshops from here on in as well so I
love doing workshops and I'm happy to be doing them again we have six more
minutes what else I don't want to waste any any moments of time here you'll
notice that sometimes these three dots this is called an ellipsis menu or a
kebab menu as well sometimes they're not active and that's when there are no
options available something I didn't point out you can rename a custom
template right from here this is super cool let's say you don't want it called
landing page let's say you want to call it blank you can rename it right from
here and bingo it gets recategorized and you can also see revisions from here now
because I have more than two or more revisions at this point you I guess I
can understand why you need two or more revisions to see this one two I don't
know I would prefer if it was active even with one revision but that's that's
a core thing what else let's go back let's go back
thank you Beverly I'm glad this was useful I think that's it I think I think
we've reached the end I I feel like I was talking very fast I hope it wasn't
too fast and and I hope you learned some stuff I hope even the folks who are more
experienced with templates learn some things and I hope to see you again at
another webinar in the future yes this session will be posted this session will
be posted on WordPress TV and I will add the link to that once it's up in the
meetup event so if you come back to the meetup in the comments there will be a
link to the session I'm gonna stop recording