Hello everyone,
I’m trying to add a shortcode to wordpress but I’m not very good with PHP and have an issue. I’ve created the code that looks like this:
function calculatorMapContent() {
return 'MAP GOES HERE';
}
add_shortcode('calculatormap', 'calculatorMapContent');
But the code that I need to put inside the return has both “” and ‘’ quotations in it because it uses inline javascript. How can I work around this issue? I thought of maybe packaging the code in a file and calling it. Any help would be appreciated.
Example of map code:
<area alt="" coords="169,186,187,192,217,193,232,114,222,80,211,88,200,94,193,98,193,101,179,120,176,120,176,126,172,132,165,146,160,148,160,152" shape="poly" href="javascript:document.getElementById('#northwest-territories').click();setTimeout(function(){ window.scrollBy(0, 300); }, 400);" />