I try to use the JQVMap plugin for a custom page template. This only works if I put the javascript into _main.js
. But, I want to loop over a custom post type to fill all the countries with a color. Then I need to do something like this, within the custom template:
`
`
Please ignore the syntax. I’m migrating this website from another language to Wordpress.
As far as I know, I can’t put this into a separate .js
file and load it with the wp_enqueue_script()
function as I need to loop over WP_Query results. But “inline” javascript seems not to work either.
Anyone?