Header and Footer Scripts
Scope of the plugin Header and Footer Scripts Plugin.
WordPress Theme directory have thousands of awesome standard themes. And the makers of WordPress created a boundary line between theme and plugin. According to their latest post, Header and Footer Scripts and such feature should be in plugin territory.
A long ago Chip Bennett posted:
Arbitrary Header/Footer Scripts: Themes must not provide Theme options for arbitrary header/footer scripts.
Arbitrary scripts are non-Theme-specific scripts added to the document head or footer to provide non-Theme-specific functionality. Such Scripts are Plugin territory, and pose a significant security risk if not handled properly. Custom CSS is acceptable, if properly sanitized.
It means Theme developer will not add these features to WordPress themes or the themes who strictly follows WordPress recommendations. However, there are plenty of great themes who do not follows many such things (it includes most premium supported themes). So, if you use such plugins then you probably do not need such plugins.
Who should use this plugin?
This plugin is written for its simplicity so many most of you will get benefited. If your theme do not have functionality to add custom meta informations like rel=”publisher”, Google Analytics (or other web analytics scripts) or even post specific javascript or css all of this can be added by this simple lightweight plugin.
However, This plugin is not for Genesis Framework user or any other theme having such functionality. Also, If you need more (or less) features then there are other plugins available in the official WP respiratory. Currently, I don’t have any immediate plan to add more features.
Installation:
The installation of this plugin is not different most of the plugins. You should navigate to your WordPress Dashboard --> Plugins --> Add New and search "Header and Footer Scripts"
.
After Successful installation a sub-menu “Header and Footer Scripts” will be created under Settings. There will be two sections called Header scripts and Footer Scripts.
You may add as much as scripts you want (but don’t do so). The Header script will add all those scripts to <head> of every page. Whereas, the Footer Scripts will insert all the codes to wp_footer
(or just before the closing body tag).
Quick tip: For optimal performance of your site it is recommended to add all CSS to head and JavaScript to footer.
Note: This plugin will not execute any php code.