Custom Global PHP Function in WordPress

In this article, we are going to see how to create your own PHP function used globally in WordPress in three steps.

STEP 1

Go to Appearance -> Editor from the navigation pane.

STEP 2

Once the page is loaded, open Theme Functions (functions.php) which you find on the right side of the Theme Files section.

STEP 3

At the end of the script of functions.php , you can start writing your own function.

You can invoke these functions in any of your PHP theme files.

Hope you find it helpful! If you want to leave us any queries, please drop them in the comments section. Thanks!