Posts

WordPress plugin or functions.php

You want to change something to the functionality of your WordPress website. A change more complicated than just removing or adding a tag. At that point you will have to decide whether to write a plugin or to add a function to functions.php

What is the difference?
A plugin is part of the WordPress installation in general, functions.php is part of the theme you use. Every theme has its own functions.php file.

So before you start, decide whether your functionality is theme related or WordPress (this includes other plugins) related.

Does it matter?
It does when you start to change things.

Let’s say you put a function that is in fact WordPress related into functions.php. This will work initially, but when you change your theme it will stop working. You will have to transfer your function from your old theme’s functions.php to your new theme’s functions.php to make it work again. If however you had written a plugin for this function, things would have kept working no matter the theme change.

The other way around, if you put a theme related function in a plugin you may lose track of it and forget to remove it when you change your theme. Leaving behind a not needed function, that may even cause unexpected errors.

Other option:
Ask the WordPress/plugin/theme developer to implement the functionality, this will make the feature available to everyone.

Developing a plugin sounds much more difficult than adding a function to your functions.php file, but it is not. We’ll show you the basics in another article.