Join Morten Rand-Hendriksen for an in-depth discussion in this video Changing a function used by a template file, part of WordPress: Building Child Themes.
- View Offline
- To see the power of the functions.php file…we're going to use it to change an existing function…from the parent theme that's currently…being used in a child theme and change…its output in the child theme only.…If you go to a single post, you'll see that…at the very top we have this post meta section…that outputs the gravatar and then the author name,…the publishing time and date, and the comments link.…And then at the very bottom, we have a second section…that shows the current categories that are being used,…and if there were tags they would also appear here.…What I want to do is display the category list…in the top here along with the author and meta.…
We're going to do that by finding the function,…then importing it into the child theme functions.php,…and then rewriting the content.…Now anytime you want to change the output…of anything you see in a WordPress theme,…the way to find that output is to just…go through all the different templates that are being used.…So, because we are currently on a…single post, we are on single.php,…
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