I want to add some code to my page but not have it be inside a codeblock, any way to do this?
Specifically I want to add it as a direct child of the “<body>” tag and preferably right at the end before the closing “</body>”
Hi morecolor!
Please edit the themes\enfold\footer.php file and add your code before </body>
We recommend using a child theme to do any custom modifications
Regards,
Vinay
Hi Vinnie thanks for the quick reply,
I forgot to specify that I just want to have the code on 1 page and not all pages.
Hey!
Please add following code to Functions.php file in Appearance > Editor
function my_custom_target(){
if(is_page(21)){
?>
// YOUR CODE GOES HERE
<?php
}
}
add_action('wp_footer', 'my_custom_target');
21 here is the page ID. Please change it to match your page’s ID
Best regards,
Yigit
Excellent thanks for this, very useful.
Any easy way to make this code only show on desktop and not mobile?