Pluggable Functions

All of my themes are built with pluggable functions and Child Themes in mind. What are pluggable functions you may ask?

The parent theme has this type of code wrapping every function in the theme:

if ( ! function_exists( 'themename_setup' ) ) { FUNCTION HERE }

See the functions_exists? This basically looks for the same function name in the Child Theme’s functions.php file or elsewhere. If it exists, it will use that function instead.

So if you want to overwrite a parent theme function, simply copy over the whole function to your Child Theme’s functions.php and modify it as you wish. And viola! Your new copied function will be the one used instead.