This topic has 6 replies, 3 voices, and was last updated 10 months, 3 weeks ago ago by Luca Rossi
Hi I should add some java code in theme, to be exact just in the search bar, how do i do it/? which one is the line to edit?
Hello, Mirko,
Thank you for reaching out to us with your query.
You can use an additional plugin, like Insert Headers and Footers or add custom.js file inside child theme, here is an example – https://www.8theme.com/topic/styling-single-product-page-product-image-slider/#post-224893
Kind Regards,
8theme team
Not clear enought.
Dear Mirko,
We hope this message finds you well.
Should you prefer not to utilize third-party plugins, we kindly suggest that you insert the code snippet provided below into the functions.php file within your child theme directory:
add_action('wp_footer', 'n2t_wp_footer');
function n2t_wp_footer(){
?>
<script>
/* your javascript code will go here */
</script>
<?php
}
Replace /* your javascript code will go here */
with your javascript codes.
Should you require any further assistance, please do not hesitate to reach out.
Best regards,
The 8Theme Team
But there is talking about footer, the java code is for bar search.
Dear Mirko,
We would like to inform you that the aforementioned code will be strategically placed at the footer of the website. This is to ensure that all JavaScript libraries are fully loaded prior to the execution of your custom code.
Could you kindly specify the code to which you are referring? We would greatly appreciate it if you could share it with us, allowing for a more thorough examination.
Best regards,
The 8Theme Team
You must be logged in to reply to this topic.Log in/Sign up