athemes / Leto

Leto is a WooCommerce compatible theme that works great for any kind of shop. Leto features color and font options, blog options, integration with the Page Builder plugin so you can easily build your homepage or other pages and many more other useful features.
GNU General Public License v3.0
0 stars 4 forks source link

Wrap all your functions with `function_exists` #58

Open jserpapinto opened 4 years ago

jserpapinto commented 4 years ago

I'm doing a child theme for leto and I've been battling with changing some output of your functions.

I think a simple way to do it would be to wrap all your functions inside a function_exists function and let us override them as we want.

For context:

Now remember what was mentioned earlier – child theme functions are being executed first in WordPress. That means you can simply take the function from the parent theme, without the conditional tag, put it in file functions.php of your child theme and let it run whatever you like. That way the function in your child theme will be executed instead of the function in your parent theme.

source