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

Ajax Search with Elementor Pro results displaying twice

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Ajax Search with Elementor Pro results displaying twice

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #44713
    jon Ajon A
    Participant

    Hi There,

    Looks like i’m having an issue with search results displaying twice after the user has conducted a search query.

    To reproduce the error – go to this link: https://validstage.wpengine.com/validation-reports-archive/

    Type in “Isaac Health” and then you will see two of them pop up.

    If you could please take a look and let me know if by chance I am doing something wrong. Or please let me know if you need more info.

    Other notes:

    WP version v6.2.2
    Advanced Custom Fields Pro Version 6.1.7
    Custom Post Type UI Version 1.13.7
    Ele Custom Skin Version 3.1.7
    Elementor v3.14.1
    Elementor Pro v3.14.1

    Best,

    Jon A

    #44717
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Hi Jon,

    Thank you very much for the details!

    This same exact issue was once reported, I have found the topic, it’s here. Turns out this is an issue with ECS and WordPress 6.x versions. Unfortunately they still not addressed the problem.

    Please try the snippet from this reply. While this does not resolve the original problem with ECS, but should mask the duplicates if all goes well.

    #44719
    jon Ajon A
    Participant

    You cannot access this content.

    #44720
    Ernest MarcinkoErnest Marcinko
    Keymaster

    Sure! Can you try maybe this variation:

    add_action('wp_footer', 'asp_custom_footer_script', 99999);
    function asp_custom_footer_script() {
    	?>
    	<script>
    	window.addEventListener("load", (event) => {
    		(function($){
    			$('.asp_m').on('asp_elementor_results', function(){
    				let id = $(this).data('id');
    				let seen = [];
    				$('.asp_es_' + id + ' .elementor-post').each(function(){
    					if ( seen.includes(this.className) ) {
    						$(this).remove();
    					} else {
    						seen.push(this.className);
    					}
    				});
    			});
    		}(WPD.dom));
    	});
    	</script>
    	<?php
    }
    #44721
    jon Ajon A
    Participant

    You cannot access this content.

    #44722
    Ernest MarcinkoErnest Marcinko
    Keymaster

    You cannot access this content.

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