I'm running a function on pages where the shortcode
This doesn't seem to be working unfortunately. The styles are being added to all pages.
I didn't use wp_register_style & wp_enqueue_style because this bug is still adding
<Link /> tags to the footer from those functions.
I could have used
add_action("wp_enqueue_scripts", "style_my_new_map") instead of
add_action('wp-head', "style_my_new_map") but as far as I can see and have checked, there's no difference? Still adds the stylesheets to all pages.
So my question is actually in two parts: :)
- Why is the current functions.php not working and adding styles to all pages? I'm not sure if it's the
globalcall or the
- What's the best way for me to add the stylesheets to the header of only the pages that the above shortcode is used on, assuming I will not know the page ids, etc?
Thanks in advance! P