Jonathan Bossenger
Let’s Code
Learn.WordPress.org
Creating Custom Templates and Template Parts
2
👋🏽
Welcome!
As you join, please get
your local WordPress
install ready:
1. Install and activate the Gutenberg plugin
https://wordpress.org/plugins/gutenberg/
2. Download/activate the workshop theme:
https://bit.ly/workshop-theme
3. (Optional) Install FakerPress:
https://wordpress.org/plugins/fakerpress/
Learn.WordPress.org
Let's code!
Creating Your
Primary
Templates in the
Editor
Jonathan Bossenger
Announcements
○ Welcome!
○ We’ll be presenting in focus mode.
○ You are welcome to ask questions.
○ You are welcome to unmute to ask questions, or post them in the chat.
Announcements
○ Let’s get your local install ready:
• https://bit.ly/workshop-theme
• https://wordpress.org/plugins/gutenberg/
• https://wordpress.org/plugins/fakerpress/
○ If I am going too fast, please let me know!
○ We will be posting this session to https://wordpress.tv/ afterwards
○ For more WordPress focused content please visit https://learn.wordpress.org/
Learning Outcomes
○ What are custom templates/template Parts
• A quick review of the WordPress Template Hierarchy
○ How to create custom templates from the Site Editor
○ How to create custom templates manually (and why)
○ How to create a custom template part in the Site Editor
○ How to register your custom template/template part in theme.json
Objectives 1
1. Generate some Posts (10) using FakerPress
2. Review the WordPress Template Hierarchy
a. https://developer.wordpress.org/themes/basics/template-hierarchy/
3. Create 2 additional users (author) on the site, and assign posts to them
4. Create a custom Featured Author Template for featured posts and apply it to a post
5. Manually export the template to a file
6. Register the template in theme.json
7
Objectives 2
1. Manually create a specific template for a single author archive
2. Edit the template in the editor
3. View the specific author archive vs the other author
4. Export and register the template in theme.json
8
Objectives 3
1. Create a custom comments template part
2. Manually export the template part to a file
3. Register the template part in theme.json
9
10
Let’s code.
Learn.WordPress.org
Thank You!
Questions?

Creating Custom Templates and Template Parts

  • 1.
  • 2.
    2 👋🏽 Welcome! As you join,please get your local WordPress install ready: 1. Install and activate the Gutenberg plugin https://wordpress.org/plugins/gutenberg/ 2. Download/activate the workshop theme: https://bit.ly/workshop-theme 3. (Optional) Install FakerPress: https://wordpress.org/plugins/fakerpress/
  • 3.
  • 4.
    Announcements ○ Welcome! ○ We’llbe presenting in focus mode. ○ You are welcome to ask questions. ○ You are welcome to unmute to ask questions, or post them in the chat.
  • 5.
    Announcements ○ Let’s getyour local install ready: • https://bit.ly/workshop-theme • https://wordpress.org/plugins/gutenberg/ • https://wordpress.org/plugins/fakerpress/ ○ If I am going too fast, please let me know! ○ We will be posting this session to https://wordpress.tv/ afterwards ○ For more WordPress focused content please visit https://learn.wordpress.org/
  • 6.
    Learning Outcomes ○ Whatare custom templates/template Parts • A quick review of the WordPress Template Hierarchy ○ How to create custom templates from the Site Editor ○ How to create custom templates manually (and why) ○ How to create a custom template part in the Site Editor ○ How to register your custom template/template part in theme.json
  • 7.
    Objectives 1 1. Generatesome Posts (10) using FakerPress 2. Review the WordPress Template Hierarchy a. https://developer.wordpress.org/themes/basics/template-hierarchy/ 3. Create 2 additional users (author) on the site, and assign posts to them 4. Create a custom Featured Author Template for featured posts and apply it to a post 5. Manually export the template to a file 6. Register the template in theme.json 7
  • 8.
    Objectives 2 1. Manuallycreate a specific template for a single author archive 2. Edit the template in the editor 3. View the specific author archive vs the other author 4. Export and register the template in theme.json 8
  • 9.
    Objectives 3 1. Createa custom comments template part 2. Manually export the template part to a file 3. Register the template part in theme.json 9
  • 10.
  • 11.

Editor's Notes

  • #2 TITLE SLIDE: Make a copy of this presentation to your Google Drive, and edit to replace with your details.