- Install and activate the plugin.
- Once the plugin is activated a menu item by the name of HFCM will be added to your admin navigation sidebar.
- Navigate to HFCM -> Add New.
- In Snippet Name enter a name for the snippet,
In Site Display dropdown select Specific Pages option,
In Page List dropdown select the page you want to add the JS code on,
You can leave the rest options to default.
- Once done, click on the Save button at the bottom. Your JS code will now work on that specific page.
- Navigate to Appearance -> Theme Editor from your admin dashboard.
- Select the functions.php file from Theme Files list.
In the above code replace 3 with Page ID for the specific page you want the JS code to run on.
You can also add JS code to specific posts using the below code.
Here replace 5 with your Post ID.
5. Once done, click on the Update File button at the bottom.