Singe Page insert just before </body> (Header & Footer Scripts)
-
Hi,
Thanks for this handy plugin!
I see how to add code just before </body> in ALL pages, but I need to add it to a SINGLE PAGE just before </body>.
How can I do that?
Out of interest, why is that not standard - is there a specific reason?
Many thanks
Kerry -
Hello @KerryG
This feature is not built in because in most case
<head>
is sufficient. If you want to add some script to a limited number of page/posts then use standardwp_footer
along withis_single
oris_singular
.I could help better if you share the code you want to add.
Or read the following to figure out yourself:
https://developer.wordpress.org/reference/functions/is_single/
https://codex.wordpress.org/Plugin_API/Action_Reference/wp_footer