The best way to add custom functions to wordpress

Home » wordpress » The best way to add custom functions to wordpress
Best way to add custom functions to wordpress

The best way to add custom functions to WordPress without braking it

Adding custom functions to your WordPress can be time consuming and sometimes unsafe. As a freelancer, I deal with all kinds of WordPress tweaks and tasks, and my priority is to get them done as fast as I can without breaking anything.

Using custom functions to solve various client requests speeds up my work enormously, but can at times be unsafe in the terms of braking the clients website completely. When talking about speed that simply means that i have developed a system of doing everything through the WordPress admin panel.

White screen and broken website after editing functions.php

This happens for various reasons, but the most common one occurs if the existing website plugin interferes with one of the functions or if I make a typo in the code or leave an unwanted white space somewhere.

The standard practice is to write your custom function, then usually insert it into theme functions file – functions.php. This works perfectly if you don’t make any of the mistakes mentioned above. But what if you do? Then the whole website goes blank white page and we really don’t want that to happen… Like.. EVER!

To be honest, for us developers is not a big thing really as the solution to it is simply logging into FTP or Cpanel and erasing the last made changes to the functions.php file. But if you have your client online and browsing his website then it can cause some panic 🙂

Adding custom functions the easy way – My Custom Functions WordPress plugin

Russian guy called Arthur Gareginyan has come up with a great plugin that I use as a standard plugin on all of my websites.

It simply does the following..

1. It lets you insert your custom functions using the admin panel without ever touching your functions.php file.

2. It pre- runs the code and informs you if there is an error in it… “FATAL ERROR” as one of my clients once corrected me 🙂

As a result your website will NEVER GO BLANK again due to your typo or a bad code.

It’s completely free and awesome. So go ahead install it, check it out and make sure to rate it 5 stars on The WordPress Plugin Repository

My Custom Functions WordPress plugin by Arthur Gareginyan

my custom functions wordpress plugin

Features:

  • Responsive & Mobile optimized settings page
  • Checks the entered code for fatal errors (simple checks)
  • Trigger for temporary disable the custom functions
  • Easy disable option for WSOD
  • Syntax highlighting (by CodeMirror)
  • Line numbering
  • Active line highlighting
  • Editor allow for tab indentation
  • Ready for translation (POT file included)

It’s really useful in case of any theme update, because your custom function wordpress PHP code would never be overwritten. Your custom function PHP code will keep on working, no matter how many times you upgrade or switch your theme.

Using my Custom Functions WordPress plugin

Here is how to add your custom functions without braking anything.

  1. Install the plugin from WordPress repository or through your admin panel by searching for ” my custom functions”

2. Go to > appearance > my custom functions

3. Enter your custom functions and hit “save changes” voila- there it is 🙂

4. What happens if i enter a wrong code?

Now this is what the plugin is all about, it wont be applied and you will get a warning about it without getting the white screen of death or having to access the functions.php to revert it.

The best way to add custom functions to WordPress without braking it – solved!

If you like this post share it around, thanks 😉

Nikola fivera Petrovic
Get in Touch

Nikola fivera Petrovic

Hi there. My name is Nikola,
I speak English, Greek and Serbian.
As a Web Producer i can deal with almost anything web design & development related.

Web Design Skills

I have been into web design for the last 10+ years.
After working for various agencies and companies I have decided to take a lone wolf path as a Freelancer but I still actively collaborate with agencies across the globe.
I enjoy building websites on WordPress platform but i can work on any other platforms as well.

SEO Skills

I have spent a last couple of years as an SEO executive and SEO consultant working on 4 continents.
Specialized in on-page SEO I wear a pointy Google-Wizard White-Hat and help various small and medium-sized businesses rank well in the search engines.
I enjoy working with Google and Yahoo SE.
Feel free to request a free meeting bellow.
As a freelancer, I charge only a small portion of the money you would pay to agencies to get your project done.
Nikola fivera Petrovic
Get in Touch
2017-04-16T04:13:33+00:00

Leave a Reply

Be the First to Comment!

Notify of
avatar
wpDiscuz