What is a plugin in WordPress? How is it different from a theme?
A plugin is a PHP file or folder which adds a feature to WordPress, like a contact form, SEO tools, backups or an online shop. It works with hooks, so the core files are not changed.
| Point | Theme | Plugin |
|---|---|---|
| Job | Design and layout | Features and functions |
| Changes when you switch it | The look of the site | The feature turns off |
| Folder | wp-content/themes | wp-content/plugins |
| Active at a time | Only one theme | Many plugins |
A good rule: if the code is about how the site looks, it belongs to the theme; if it is a feature which must work with any theme (like a custom post type), make a plugin.
See WordPress Plugins and Create a WordPress Plugin.
Learn more about the similar topics:
| Tutorials |
|---|
| No Content Found. |
| Exercises & Assignments |
|---|
| No Content Found. |
| Interview Questions & Answers |
|---|
| No Content Found. |