Overriding Parent Functions from a Child Theme

There is a great post, albeit a bit old (2015) on tutsplus.com about overriding parent functions:
A Guide to Overriding Parent Theme Functions in Your Child Theme

Here is my tl;dr version:

1. Even when using a Child Theme, all of your Parent Theme functions will still run.
2. The functions in your child theme will be loaded before the functions in the parent theme.
3. Priority is very important. Higher priority wins.
4. If you are simply removing an action or filter, you need to do it from inside a function because that will ensure it runs AFTER the parent one has run.

As someone who often edits other people’s themes, these are very useful tools to know!

Advertisements

Theme Resources: The Theme Handbook

I run a local WordPress Meetup and so I have the privilege of meeting a lot of folks early in the WordPress journey.  One question I get often from people just starting out to create their own themes is this:

Where should I go to learn more?  

Luckily we have an amazing Theme Handbook on WordPress.org that covers all the basics of creating themes:

WordPress Theme Developer Handbook

Even if you’ve been doing it for years, it’s still a good place to check to make sure you’re doing things the best way possible.

Some highlights include:

Using the Customizer API

Localization (a personal favourite)

Accessibility

Releasing your Theme

The whole thing is great so make sure to take advantage of it!  Of course, you can always join the Documentation Team and contribute to this yourself.