Header and Footer Script Loader - Adding a Script
Adding a Script
You can add unlimited number of scripts and styles. This guide covers how to add and manage them.
To manage scripts, navigate to Admin Dashboard → CM Header and Footer Script Loader → Settings.
Add New Script
Click the button Add New Script to show or hide the form for creating a new script.
The form by default shows only basic options. More options can be shown or hidden by clicking Expand / Collapse Additional Settings:
The options for each script are:
- Script Name - Enter here the script name. The script name will help you later identify your scripts and styles but other than this does not have any impact.
Example:
- Script Code (CSS, JS, PHP, HTML) - Add here the code of the script itself.
Example: Google Analytics Code
- Note - Add here a note that describes what this script is for. It will help you later identify what this script is for when overriding global settings for a specific post or page. Note: this option was introduced in version 1.1.8.
Example of the note:
This note will be shown in a tooltip for a script in the metabox for posts and pages:
- Script Type - Select the type of script. This ensures the script is handled and applied correctly on the page.
You can choose between:
- CSS
- JS
- PHP (note: this script type was introduced in version 1.1.8)
- HTML
- Script Location - Choose where the script will be added on the page. This is important aspect to help you optimize your WordPress site performance.
You can choose between:
- Header Script
- Footer Script
- After opening body tag
- Before Content (note: this location was introduced in version 1.1.8)
- After Content (note: this location was introduced in version 1.1.8)
- Device Type - Choose which device types will trigger the script.
You can choose between:
- All Devices
- Desktop
- Mobile
- Where to Load - Specify where the script should load. You can override global settings for specific pages or posts. You can choose between:
- Load by default on all posts and pages - The script will always load unless the script is disabled for specific posts or pages.
- Load on homepage only - The script will load only on the page specified as a homepage.
Load on specific post types - The script will load only on the selected post types.
Load on specific URLs - The script will load only on the specified URLs. Enter one URL per line. You can use simplified URLs (e.g., /example/) instead of full URLs. Wildcards (e.g., /example/*) can be used to apply the script to all child pages under a specific URL. Each URL should be on a separate line.
Load by post categories - The script will load only on posts that belong to selected categories. Note: this option was introduced in version 1.1.8.
Load by post tags - The script will load only on posts that belong to selected tags. Note: this option was introduced in version 1.1.8.
- Don't load by default - This will prevent the script from loading automatically and will still leave the option to turn it on for specific posts and pages.
- Timeframe - Set specific time intervals when the script should be active. To add multiple intervals, click the "+" button. If no timeframes are set, the script will run continuously. Note: this option was introduced in version 1.1.8.
Example:
- Pause Script - Check this box to pause the script. Note: this option was introduced in version 1.1.8.
- Save Script - Click this button to create the script.
Managing Scripts
Once the script is created, it has the following 2 buttons:
- Update - If you edit the script, click this button to save the changes.
- Delete - Click this button to delete the script.
Each new created script appears at the top of the list. So the scripts are ordered from newest to oldest.
At the top, you can see 2 more items:
- Cleanup Database - This button allows you to completely remove all scripts created with this plugin.
- Search - This search bar allows you to look for created scripts by their titles.
More information about the CM Header and Footer Script Uploader WordPress Plugin Other WordPress products can be found at CreativeMinds WordPress Store |
|
Let us know how we can Improve this Product Documentation Page To open a Support Ticket visit our support center |