Run Product Filter Javascript On Page Template
I am trying to run the below script on a vehicles WordPress page template. The page template shows products that are the result of a product filter (make, model, year, transmission, etc..).
The product filter uses Javascript. This is replacing a current WordPress product filter that is too slow.
The page the products are displayed on is www.example.com/vehicles
I did try adding the script to the content editor, it displayed correctly on the page, but for some reason the URL keeps changing (need to figure out that strange issue).
Also, I am thinking this script should not be in the page content editor or in the page template, but instead located in the functions.php file.
I am not sure what the code should be in the functions.php file and also the code needed for the page template to call the script.
Any help is greatly appreciated.
<link href="https://example.thirdparty.com/static/css/chunk.css" rel="stylesheet">
<link href="https://example.thirdparty.com/static/css/main.css" rel="stylesheet">
<script src="https://example.thirdparty.com/static/js/runtime-main.js"></script>
<script src="https://example.thirdparty.com/static/js/chunk.js"></script>
<script src="https://example.thirdparty.com/static/js/main.js"></script>
Leave an answer