How to get this JavaScript working with get_permalink
Probably the best way to do this is as suggested above by using wp_localize_script. You haven’t mentioned how you’re including the javascript – but I’m going to assume you’re doing it the WordPress way. So, something like this: add_action( ‘wp_enqueue_scripts’, ‘wwm_enqueue_scripts’ ); function wwm_enqueue_scripts() { //see the documentation if you don’t understand what’s going on … Read more