Replacing existing functions


show more Replacing 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 ...

Replacing existing functions

From time to time you'll want to disable or replace existing functions altogether. This can be because you want to remove the function or because you want to replace it with something completely different. To get a clear picture of when this would happen, it's important to understand what types of functions you're likely to find in the functions.php file. In addition to the typical WordPress functions like the ones you have seen-- menus, sidebars, navigation, and so on-- the functions.php file also often carries with it calls to style sheets and JavaScript through what's known as enqueueing.

If you want to disable these, you need to dequeue them. If you look at the functions.php file from the parent theme, you'll see here on line 90 you have this function called twentytwelve_scripts_styles. Inside this function you have several scripts that are enqueued so that WordPress can use them. You see one here, wp_enqueue_script ( 'comment-reply' ), directly below it wp_...

Replacing existing functions
Video duration: 2m 36s 3h 11m Intermediate Updated Nov 27, 2012

Viewers:

Replacing 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 ...