How to edit the functions.php file in WordPress

Posted in Tutorials

Tweet This Share on Facebook Bookmark on Delicious Digg this Submit to Reddit

The functions.php file is the theme’s function file where WordPress action and filter hooks are placed.  In many of our tutorials, we will mention to edit the functions.php file.  Here is how…

Editing the functions.php file using WordPress Editor

In the WordPress Dashboard, go to “Appearances -> Editor” and select the “Theme Functions” file on the right sidebar…

edit functions file

edit functions file

Now you can edit the file in the editor and click “Update File”.

Editing the functions.php file using FTP

In some WordPress setups, the editor will not allow you to edit the file.  In that case, you have to edit the file on your server using FTP.

The file is located in your currently active theme’s directory.  For example, if your current theme’s folder is called “twentycustom”, then the file will be in …

/wp-content/themes/twentycustom/functions.php

To determine your current theme’s folder, go to “Appearance -> Themes” and click on “Theme Details” for the active theme…

active theme details

active theme details

In the theme’s detail page …

image location

image location

right-click on the image to get the image URL.  This URL will contain the path to your currently active theme.  In our example, the theme image is located in …

/wp-content/themes/twentycustom/screenshot.png

As you can see the theme directory is “twentycustom”.