To install Common Ninja’s script globally on a website hosted with any cPanel provider, follow these general steps:
Step 1: Access Your cPanel
- Log into your hosting provider’s cPanel account.
- Look for the File Manager option, usually located under the Files section, and click on it.
Step 2: Locate the Website’s Root Directory
- In File Manager, navigate to the public_html folder, which typically contains your website’s main files. If your website is in a subdomain or subfolder, locate that specific directory.
- Once in the correct folder, look for the main file where you’ll add the script globally:
- For static HTML sites, this is often
index.html
orindex.php
. - For PHP-based CMS platforms (such as WordPress), this may be the
header.php
file within your theme’s folder (usually found underpublic_html/wp-content/themes/your-theme-name/
).
- For static HTML sites, this is often
Step 3: Edit the File to Add the Common Ninja Script
- Right-click the file you want to edit (e.g.,
index.html
orheader.php
) and choose Edit. - In the editor, find the
<head>
section near the top of the document. Paste the Common Ninja script within the<head>
tags to make it global across all pages:<script src="https://cdn.commoninja.com/sdk.js"></script>
- After adding the script, click Save Changes to ensure the code is saved.
Step 4: Verify the Script Installation
- Open your website in a new browser tab or window.
- Check if the Common Ninja widget (such as popups, bars, or notifications) appears and functions across your site as intended.
Troubleshooting Tips
- Clear Cache: If the widget doesn’t appear right away, clear your browser cache or use an incognito window.
- File Selection: Ensure you edited the correct file. For CMS-based sites, editing
header.php
in your theme directory will apply the script site-wide. - Backup: For PHP files (like
header.php
), create a backup before making changes to avoid breaking the site in case of an error.
Important Notes
- Static HTML Sites: For purely HTML sites, adding the script to
index.html
within the<head>
section will make it global for that file, but you’ll need to add it to each HTML file individually if they’re separate. - CMS-Based Sites: For platforms like WordPress, editing the main
header.php
file in the theme folder applies the script globally without needing to add it to each page manually.
This method applies to most websites hosted on cPanel, allowing you to install the Common Ninja script globally and enable functionality like popups, bars, and notifications across the entire site.
Comments
0 comments
Please sign in to leave a comment.