• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

AreWeConnected.com

Custom WordPress Websites that Rock!

  • Home
  • About
    • Hire a Tech Dude!
    • Recommendations
    • Add your testimonial
  • WordPress
    • Custom WordPress Website Build
    • The Managed EVERYTHING Website!
    • Making your site “SECURE”
  • FAQ
    • Making Your Site SECURE
  • BLOG
    • Posts about WordPress
    • Guest Post and Comment Policy
  • Contact

QOTW: Modifying the functions.php file safely

Wordpress · September 25, 2015

75
SHARES
FacebookTwitterSubscribe

The Question of the Week today falls under the “Advanced WordPress” category. Anytime you get into functions.php I think that’s more advanced than the average user – don’t you?

My good friend Matt asked

Matt asked a question on Facebook.

“Mike Mueller I figured you’d be a good person to ask…if you have a child theme (Genesis parent) in WordPress, is it possible to add functions without adding to functions.php…like some sort of “grandchild” theme technique? I know what and how I want to change something and even know it works, but wanted to know if there was a way to “protect” that code in case there was an update.“

The reason Matt is asking this is because he knows the 1st Rule of WordPress.

The 1st rule of WordPress

Snippet from a function.php fileThe function.php file is the place where you can mod a bunch of stuff if you are trying to make a theme work better for your needs.  It controls things like the size of your logo, widget boxes, menu bars and so much more.

EXTREME CAUTION: Misplace just one character in your code, you’ll end up locked out of your site – so you need to be very very careful.  The best way to make changes is via FTP or a File Manager.

Matt’s concern is that when he makes the changes he wants, if there’s an update to that theme, it’ll wipe out his changes.  That’s absolutely true, he’s right.

The theme files that come with an update generally include and replace the existing ones.  That said, Genesis Child themes hardly, if ever need an update.  WordPress Core does so, as does Genesis itself but the child themes.  The key word is “HARDLY”.  It does and can happen.

  1.  You could simply keep a copy of the Functions.php file handy in your hard drive somewhere, or
  2. There are plugins that will allow you to addon to your file (but I haven’t used them), or

    https://wordpress.org/plugins/code-snippets/
    https://wordpress.org/plugins/code-snippets/
  3. Another way around this, to be totally safe, would be to create your own child theme.

I work on the WordPress.org Training Team.  We are creating lesson plans for people to teach WordPress with. One of the plans we have is on creating a Child Theme. Check out the work we’re doing!

RELATED: When it comes to modifying the CSS – the same rules apply.  Never mess with the themes style.css – always use an addon. JetPack has one and then there are plugins that will do the same.

I hope that answers your question Matt.

  • Author
  • Recent Posts
Mike Mueller
Connected?
Mike Mueller
VP of Happiness at AreWeConnected.com
A former professional hand model, Mike builds Custom WordPress Websites that rock!


He's an avid hockey fan, rides a mountain bike, sometimes rides a road bike, has a few motorcycles (he had a really fast one, bought a cool orange one, rode a really slow one, and now,a perfect "BDR Weapon"). If that isn't enough, he makes cheese and sourdough bread, loves strong beer and good red wine, and poorly plays the Mandolin.
Mike Mueller
Connected?
Latest posts by Mike Mueller (see all)
  • The Ultimate Guide to Writing the Perfect Blog Post - March 14, 2023
  • 8 Questions Your Web Developer Should Have Asked - April 27, 2021
  • Slack, Chat or Discord? - April 6, 2021
75
SHARES
FacebookTwitterSubscribe
New Comment Policy:
If you see something, say something!
(shamelessly borrowed from Homeland Security but really, let's bring commenting on posts back!)

Filed Under: Wordpress

Previous Post: « 10 things to do on your website over a 3 Day Weekend
Next Post: What a hacked WordPress website looks like… »

Primary Sidebar

Who runs this Pop Stand?

Mike Mueller
Mike@AreWeConnected.com
PH: (925) 456-4567

Connect

  • Facebook
  • Flickr
  • Instagram
  • LinkedIn
  • RSS
  • Tumblr
  • Twitter
  • YouTube

Look, it’s Just a Newsletter!

  • While I might write a bunch, the newsletter is set to go out only on Wednesdays. That's it!  Just one day a week! Can you handle that?
  • This field is for validation purposes and should be left unchanged.

FREE Downloads

Icon
1843Small Biz Websites Built so far…

Let's Build Yours!

Expert Google Workspace help

Get Started and then hire the right help!

Lighten up!

Search: (anything)

Sign In / Up

  • Account
  • Website Management Subscription
  • The Managed EVERYTHING Website!

Who to host with?

It's the #1 question I'm asked - where to find inexpensive shared hosting. Here's who I recommend.
Data Servers are a HUGE drain on the power grid. Here's a host that sources 300% of it's power from Wind and Solar! On top of that, their service ROCKS!
Check out GreenGeeks

Need more power?

WPEngine has it!

Hacked?

Sucuri Security
Creative Commons License
This site was built, is hosted, and backed up, and maintained by Mike Mueller. AreWeConnected is about the open sharing of ideas without a hidden agenda. Assume any link on this site is an affiliate link, Clicking on affiliate links costs you nothing extra (probably saves you $) and helps support this site.
PRIVACY POLICY

MANAGE YOUR ACCOUNT

...another Custom Wordpress Website by Mike Mueller Hi!