Join Morten Rand-Hendriksen for an in-depth discussion in this video Solution: Add a template for the Aside post type, part of WordPress: Building Child Themes.
- View Offline
- The challenge is done…and hopefully you're successful in completing it.…Now let me show you how I would solve this challenge.…Like I hinted that in the challenge movie,…the first place to look is in the index.php file…because as I pointed out, we have this get_template_part…and then get_post_format functions…that work to grab the correct template part…to display the actual content.…But if you look just above it,…you have a complete explanation…of exactly what you need to do.…In the comment here, it says,…"Include the Post-Format-specific template for the content.…
"If you want to override this in a child theme,…"then include a file called content- space .php,…"where space is the Post Format name,…"and that will be used instead."…So what we need to do is create a new file…called content-aside.php…and that file work again.…However, there's a small detail here…that you need to pay attention to.…If you look at the get_template_part function,…you'll notice the first parameter calls…for template-parts/content.…
This might have tricked you up.…
WordPress: Building Child Themes opens the world of child theme development to anyone, no matter what level of experience or expertise. It helps you build your child theme on top of an existing properly coded foundation, and create stylish new WordPress sites—without the advanced knowledge of a web developer. Morten Rand-Hendriksen explains how to get started picking a parent theme, updating the CSS, creating a new template for your child theme, and updating its functionality. By the end of this practical, project-based course, you should have a functioning child theme and the skills to quickly customize your next WordPress site.
- What is a child theme?
- Creating and activating a child theme
- Overriding or overwriting?
- Changing existing styles
- Adding new styles
- Creating templates for the child theme
- Adding new menus and widgets
- Replacing custom web fonts