Create functions.php file to insert WordPress custom codes

Create functions.php file to insert WordPress custom codes

Functions.php is usually a file used to customize the functionality of themes and plugins in WordPress. If you are a Genesis Framework user, you should be familiar with this file because almost every customization in Genesis is done through the functions.php file. However, inserting PHP code directly into the theme's functions.php file also causes certain inconveniences. For example, some themes have hidden functions.php files and users have a hard time finding them. If you are not careful, you can even cause functions.php file errors in the process of adding code, affecting the visibility and functionality of the interface. Not to mention that these codes can be deleted when you update the theme to the new version.

Do not worry. Because, shortly, I will show you how to create a completely new functions.php file (separate from the theme's functions.php file) and thoroughly solve the aforementioned problems.

Create functions.php file with the Functionality plugin

1. First, you need to install and activate the Functionality plugin.

Create functions.php file to insert WordPress custom codes create functions.php file Create functions.php file to insert WordPress custom codes functionality

2. Next, go to Plugins > Edit Functions. Paste the code you want to add inside and click the Update File button to save it.

Create functions.php file to insert WordPress custom codes create functions.php file Create functions.php file to insert WordPress custom codes functionality2

That's all It's simple, right? No more worrying about where to find the functions.php file. There is also no need to be afraid of making a mistake in the theme's functions.php file while adding the code.

Some other plugins

If you do not want to use the Functionality plugin, you can try the Code Snippets or My Custom Functions plugin with completely similar functions. The usage of these plugins is also very simple so I will not guide in detail here.

What method do you usually use to insert PHP code into your WordPress website? Please share it with us in the comment box below.

-- Create functions.php file to insert WordPress custom codes --

 

Explore more:

Remove unnecessary Jetpack CSS from your WordPress website