how to get permalink
To get a permalink you need to use get_permalink(). Just pass the ID of the post or leave it blank to get the current page in the Loop. wp_localize_script () will render PHP variables on the page that are consumable by JS through a global object that you define. PHP // Register the script wp_register_script( … Read more