Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search Setting Not Visible in the Frontend › Reply To: Search Setting Not Visible in the Frontend
Hi,
Thank you for the details!
The issue was caused by a node duplication in the header – it looks like the menu script creates duplicates of some of the elements. That should never be done as duplicating nodes lead to duplicated IDs, invalid HTML and possible issues within anything that uses javascript. Unfortunately some theme/menu developers still do this, despite the fact that it is a very bad practice.
While the issue is not caused or relates to our plugin, I was able to find a possible solution, I have added the following code snippet to the functions.php file:
add_action('wp_footer', function () {
?>
<script>
window.addEventListener("load", () => {
const instances = ASP.instances.get(1);
if ( typeof instances[1] !== 'undefined' ) {
instances[1].destroy();
}
});
</script>
<?php
});
This will remove the duplicated search and will resolve the issue. Still, I strongly recommend investigating why elements are being duplicated to a separate node in the header, and if it’s possible then stop it alltogether to avoid any issues.