This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Search Setting Not Visible in the Frontend

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Search Setting Not Visible in the Frontend

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #52914
    mosesdinakaran_ol9Nmosesdinakaran_ol9N
    Participant

    Hi Team, For some reason the search setting is not visible in the frontend can you please help
    I have created the below custom attributes
    Lyricist
    Vedanayagam Sastriar
    H.A. Krishna Pillai
    Singer
    Dr. D.G.S. Dhinakaran
    Fr. S.J. Berchmans
    Raga
    Shankarabharanam
    Mohanam
    Thala
    Adi Thalam (8 beats)
    Rupaka Thalam (6 beats)

    I was expecting Categories and these custom fields visible in the search setting, But its not happening
    Can you please support

    #52915
    Ernest MarcinkoErnest Marcinko
    Keymaster

    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.

    #52916
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Update

    I have made a quick patch to this and included in the core plugin. I have installed this patched version on your website, this fix will be included within the next update.

    I have also removed the code as it is no longer neccessary, the plugin detects the duplications now.

    Also made a small change in the theme header php file so the simple shortcode is now used correctly.

    #52917
    mosesdinakaran_ol9Nmosesdinakaran_ol9N
    Participant

    It does works now Thank you very much for the quick solution. Let me explore more and will get back if I face any challanges.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.