Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

does function.php get overwritten on theme update?

Tags:

wordpress

I've got to add some php functions to a theme so they can be used from different pages. The docs say one place to add custom php functions is in function.php

Cool!

My question is, what happens when I update a theme? Will the functions.php containing my changes be overwritten by a new one - thereby wiping out all my hard work?

My gut says yes but before I go and create a child theme I figured I'd ask to be sure.

Thanks

Mark

like image 547
user1126515 Avatar asked Jan 12 '13 19:01

user1126515


1 Answers

I'm just adding my 2 cents because this was the first Google result that came up when I was searching for the same question. Yes, your functions.php will be overwritten with a theme update.

I solved the problem by downloading the code-snippet plugin.

https://wordpress.org/plugins/code-snippets/

Now I can easily add and manage functions that won't be overwritten.

like image 162
Bob Garrow Avatar answered Oct 14 '22 03:10

Bob Garrow