Quantcast
Channel: Armando's Work and Stuff » Themes
Viewing all articles
Browse latest Browse all 4

The Right Way to Override Theme Functions

$
0
0

The need: override theme functions from the parent theme on the child

How: Putting the function to replace in the functions.php file in the child theme folder, this works because the function in our case that is in the parent theme has the conditional: ! function_exists. Since the child theme functions gets called before the parent it overrides it.

More info in this comment: Override function by copying, if using function_exists() call

There is no better relief than finding the exact post that solves the problem.  We have the need to not display the author link on each post in the Buro theme and the way to do it is by removing that from the function woo_post_meta().  So because I don’t want to create a new function and then search in all the theme files for where that function is called, overriding a function was the way to go!


Viewing all articles
Browse latest Browse all 4

Trending Articles