My client has provided me with some HTML code that needs to be inserted into the element in the and in the element of their Contact page. I have searched the support forum and elsewhere and cannot find details on how to do this although I have seen some vague, non-specific references about adding the code to the Child theme. Would appreciate more direction on how to accomplish this. While the site has a Child theme, I am not well versed in how to use it for more than CSS styling functions.
Hi Susan,
Thank you for writing in, is the code is pure HTML? If so, you can paste it on a Content Area or RAW Content element. However, if the instruction is to place the code inside the <head>
tag, use this following snippet, you can add this on your child theme’s functions.php file
/*Adding a code inside the <head> tag*/
function my_custom_script() { ?>
<!-- YOUR CODE HERE -->
<?php }
add_action( 'wp_head', 'my_custom_script', 999 );
More example about wp_head()
function here.
If the instruction is to place the code before the closing body tag, you can use this snippet.
/*Adding a code before closing body tag </body> */
function my_custom_script() { ?>
<!-- YOUR CODE HERE -->
<?php }
add_action( 'wp_footer', 'my_custom_script', 999 );
More example about wp_footer()
function here.
Hope it helps,
Cheers!
Seems like this did the trick. Thank you!
Cool, we are delighted to assist you with this.
Cheers!
This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.