Is there a nice way to load a js file based on the post type being viewed?
I have a supplier which has a map on it but I only want the load the js when a single one is being viewed. I load the script in my functions.php file.
If you hook onto a later action such as
Or alternatively like this...
Hope that helps.
you can use this code: