WordPress offers the flexibility of customizing the current themes to your preferences. You can decide on the functionality, features and look & feel of the themes you are using. All this is possible, by adding codes in the template file available for each theme, called “functions.php”.
For customizing the look & feel, you will need to edit “style.css”, here’s the tutorial: How to edit style.css in WordPress.
Functions.php is a theme file offered by WordPress to provide theme functions. You can customize any WordPress theme by adding the required php codes to this file. It offers you the flexibility of adding favicon to your weblog, posting thumbnail images, customizing dashboard logo, enabling threaded comments, customizing footer area and so on. You can access and edit the functions.php either by using a ftp client or simply through WordPress.
Access functions.php By Using FTP Client (We Use FireFTP For Firefox)
- Start the FTP client, select “Tools > FireFTP ” (Firefox addon to serve as an FTP client).
- Click “Connect” and provide the credentials (username and password) to connect to your FTP server (the host).
- Locate Functions.php by following the directory structure given below:
[WordPress Root] > wp-content > Themes > [current_theme] > functions.php. - Download the file and edit the file with the editor of your choice (by adding the required code).
- Upload the file to update the theme with changes made to the file.
Access functions.php Through WordPress Admin
- Log in or sign in WordPress as administrator.
- Select “Appearance > Editor” from the sidebar.
- In the editor, select the theme which you want to edit from “Select theme to edit” drop-down menu.
- Locate and double-click “Themes Functions (functions.php)” under “Theme Files”, “Templates” section.
- Make the desired changes to the file and click “Update File” to reflect the changes made to the file.
Always back-up functions.php before making changes; the back-up file comes in handy for restoring the default file in case WordPress goes crazy.