Successfully reported this slideshow.
Your SlideShare is downloading. ×

Creating Custom Templates and Template Parts

Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad
Ad

Check these out next

1 of 11 Ad

Creating Custom Templates and Template Parts

Download to read offline

WordPress 6.1 will include ways to create custom templates and template parts for your block theme from the Site Editor. These custom templates and template parts are useful when you need to display specific posts or pages using templates that don't form part of the template hierarchy.

In this session, we'll look at both how you can register and create custom templates and template parts from the editor, as well as how to register them in your theme.json file when distributing your new block theme.

WordPress 6.1 will include ways to create custom templates and template parts for your block theme from the Site Editor. These custom templates and template parts are useful when you need to display specific posts or pages using templates that don't form part of the template hierarchy.

In this session, we'll look at both how you can register and create custom templates and template parts from the editor, as well as how to register them in your theme.json file when distributing your new block theme.

Advertisement
Advertisement

More Related Content

Similar to Creating Custom Templates and Template Parts (20)

Advertisement

Creating Custom Templates and Template Parts

  1. 1. Jonathan Bossenger Let’s Code Learn.WordPress.org Creating Custom Templates and Template Parts
  2. 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. 3. Learn.WordPress.org Let's code! Creating Your Primary Templates in the Editor Jonathan Bossenger
  4. 4. 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.
  5. 5. 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/
  6. 6. 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
  7. 7. 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
  8. 8. 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
  9. 9. 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. 10. 10 Let’s code.
  11. 11. Learn.WordPress.org Thank You! Questions?

Editor's Notes

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

×