Overriding existing functions


show more Overriding existing functions provides you with in-depth training on Web. Taught by Morten Rand-Hendriksen as part of the WordPress 3: Building Child Themes show less
please wait ...

Overriding existing functions

Depending on how well a parent theme is built, you can use a series of different techniques to either override or overrule functions in that parent theme. By overriding or overruling the functions, you're telling WordPress to ignore the function that's in the parent theme or augment the function that's in the parent theme to produce the result you want. How to override a function depends on how well the theme is written, and also how that function is included in the theme. Most well-written themes wrap functions in conditional statements so that they can easily be overwritten by child themes.

When they are not wrapped in these statements you're usually given either a filter or an action hook that you can hook into or change the actions you can interact with it. Let's a take a look at some of these things in the twentytwelve theme, so you can see how you can interact with it. If you go down to line 28, you'll see an example of how a function is included so that you ca...

Overriding existing functions
Video duration: 3m 23s 3h 11m Intermediate Updated Nov 27, 2012

Viewers:

Overriding existing functions provides you with in-depth training on Web. Taught by Morten Rand-Hendriksen as part of the WordPress 3: Building Child Themes

Subject:
Web
Software:
WordPress
Author:
please wait ...