Cheesetoast

Brain Food for Web Developers

PHP Code

WordPress Functionality Plugin to Accompany Functions.php

When customizing a WordPress site it’s common practice to add tweaks and functionality to a theme’s functions.php file. As I learned recently however, this is not always the best approach.

An interesting article on WP Candy points out the disadvantage of linking site functionality to a theme that will inevitably change some day. The proposed solution is to create a functionality plugin separate from the functions file.

You can think of it as a portable functions.php file that you can take with you when you change themes.

The plugin should contain code used to modify site structure and functionality that you would require, should you change theme. Code that is specific to your theme (custom nav bars, for example) should stay in the functions.php file.

For directions on how to create your own functionality plugin read the full article on WP Candy.

Author: Graham

My name is Graham and I'm a Scottish web developer living in California. I love working with clean code to make attractive and usable websites. I'm also interested in cooking, gardening, and taekwondo.

Comments are closed.