WordPress: use plugin or functions.php file
The title may have confused you, but the article is about using a plugin or a functions.php file in our theme. In other words, knowing when it is better to use a plugin and when to use the
This question for novice users may not even interest them, because with getting one to work it is already satisfied, but we should investigate more in the operation of WordPress and make the right choice between a plugin or
functions.php file as appropriate, so I encourage you To read the full article, whether you are a newbie or not.
What are WordPress plugins?
Being brief, a plugin is a complement that adds a new feature to our program. In WordPress a plugin can be understood as a complement that adds functionalities added to our blog.
What is the functions.php file?
In the folder of your theme in most cases there is a file with the name
functions.php . This file, also known as a ” function file “, acts as a plugin but only adds functionality to the theme to which it belongs to the file. It is important to emphasize and understand that
functions.php only affects the selected topic and when it is active.
Which is better a plugin or functions.php file?
Many people ask themselves this question and the answer is quite complex since it depends on each situation. Sometimes it will be better to use a plugin and in others it will be better to use the
To be able to choose between both methods we have to be clear about the functionality we want to add to the blog and depending on this we will choose one or the other method.
For example, if what we want to add to the blog is a more global functionality such as adding the Google Analitycs code, adding SEO functionality or adding functionalities in user permissions, in these cases we will use a plugin , since they are features that It will not depend on our theme, but more global and independent of the theme we use.
For example, let’s use the theme we use, we will always want to have Google Analitycs statistics, we will always want to have SEO functionality or custom user permissions.
At the other end we have the functions.php file that is used to give specific functionality to the theme we are using. The functions.php file can be used to add sidebars, menus, customize widgets, etc. That is, the
functions.php file exclusively affects the functionality or design of the subject in question.
From the previous examples we can deduce that it is not possible to say that it is better to use a plugin or the functions.php file in a general way, but that each situation must be analyzed to select whether it is best to use a plugin or the functions.php file .