FUNCTION.PHP file versus PLUGIN in wordpress
If you have ever played with a theme, you will know it has a functions.php file, which enables you to build plugin-like functionality into your theme.If we have this functions.php file,what is the point of a use of plugin ?
Where should we use plugin and where should we use function.php file ?
Basically it all depends on your need.
Both do the same work , but the main difference is that a plugin’s functionality persists regardless of what theme you have enabled, whereas any changes you have made in functions.php will stop working once you switch themes.
Also, grouping related functionality into a plugin is often more convenient than leaving a mass of code in functions.php.
So it will be a good idea to use plugin if you want to use same code with different themes and different projects.
If you have ever played with a theme, you will know it has a functions.php file, which enables you to build plugin-like functionality into your theme.If we have this functions.php file,what is the point of a use of plugin ?
Where should we use plugin and where should we use function.php file ?
Basically it all depends on your need.
Both do the same work , but the main difference is that a plugin’s functionality persists regardless of what theme you have enabled, whereas any changes you have made in functions.php will stop working once you switch themes.
Also, grouping related functionality into a plugin is often more convenient than leaving a mass of code in functions.php.
So it will be a good idea to use plugin if you want to use same code with different themes and different projects.
No comments:
Post a Comment