WordPress is undoubtedly one, if not the best CMS out there.
I mean, take a look at these stats compiled by Tom Ewer:
- More than 409 million people view more than 23.6 billion pages each month and users produce 69.5 million new posts and 46.8 million new comments every month.
- 48% of Technorati’s Top 100 blogs are managed with WordPress
- Over 76 Million sites online depends on WordPress
- WordPress-related keywords accounts for more 37 million searches per month
- WordPress has been translated to more 40 global languages
- 22% of new U.S. registered domains run on WordPress
- There has been 46 million WordPress downloads from WordPress.org
- WordPress is the most popular CMS used by business websites
You could rightfully say that one thing that makes WordPress so irresistible is its extendibility.
Beyond it being a publishing platform that allows anyone not only to write easily, you could as a WordPress user literally tweak any part of WordPress to to suit your need whether business or personal.
One of the ways to change WordPress default behavior is using a file named functions.php that you find in your theme’s folder. It behaves like a WordPress plugin and you could use it to add features and functionality to your WordPress website.
Below are the core differences between the two:
- requires specific, unique Header text.
- is stored in wp-content/plugins, usually in a subdirectory.
- executes only when individually activated, via the plugins panel.
- applies to all themes.
- should have a single purpose, e.g., convert posts to Pages, offer search engine optimization features, or help with backups.
WordPress functions.php file
- requires no unique Header text.
- is stored with each Theme in the Theme’s subdirectory in wp-content/themes.
- executes only when in the currently activated theme’s directory.
- applies only to that theme. Do note that when the theme is changed, the functionality is lost.
- can have numerous blocks of code used for many different purposes.
Having said that, here are some of the things as laid out by John Hughes of ElegantThemes that you could do with WordPress functions.php.
There are two things worth bearing in mind before starting off:
- if a WordPress plugin calls the same function, or filter, as you do in your functions file, the results can be unexpected — even site-disabling.
- before implementing any of these changes, backup your functions.php file. In fact, do not attempt to make these changes on a live site. Instead, create a dev environment locally using MAMP or WAMP, try these out before implementing them on your live site.