Adding to existing functions


show more Adding to 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 ...

Adding to existing functions

Sometimes overwriting an existing function is not what you want to do. You'll will often find that a function has a lot of elements you already want and all you want to do is add some more to it. In those cases, you can use your child theme functions.php file to add the extra functionality to the existing function. There are some great examples of how you can add on to existing functions in twentytwelve and many of these examples you'll find in most WordPress themes. If you go to the functions.php file for twentytwelve and you go to line 64, you'll find register_nav_menu.

This is where you register the main menu inside your WordPress site. If you look at the site, you see there is a nav menu right here at the top and if I go into the Dashboard > Menus, you'll see that menu is listed right here. Your theme supports one menu and it's called Primary menu. Going back into functions.php, you'll see this is where Primary menu is defined. In your child theme you can no...

Adding to existing functions
Video duration: 3m 21s 3h 11m Intermediate Updated Nov 27, 2012

Viewers:

Adding to 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 ...