First item in search results displaying twice

Home Forums Product Support Forums Ajax Search Pro for WordPress Support First item in search results displaying twice

This topic contains 10 replies, has 2 voices, and was last updated by mckots87 mckots87 1 year, 9 months ago.

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #37846
    mckots87
    mckots87
    Participant

    Hi, for our Attorney Directory (Attorneys post type) on our site, for some reason the first entry of any search query whatsoever is displaying twice. (see screenshot)

    – We are using Elementor Pro and a Loop Template made with Ele Custom Skin
    – Not happening with other Post Type “News”

    Attorney Directory URL: https://chicagocommittee.org/attorney-listings/

    I’ve reviewed all the settings and I cannot figure out why this is happening, any help here is really appreciated and thank you!

    Mike Kotler

    Attachments:
    You must be logged in to view attached files.
    #37849
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    The issue here is probably the custom loop with the elementor skin. We can not officially support 3rd party elementor plugins, as those can directly conflict with the search results loop, and create issues like this.

    If you want, you can add temporary FTP access, I can try to debug the the override code, to see if there is anything to do, but I can not promise anything.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #37852
    mckots87
    mckots87
    Participant
    You cannot access this content.
    #37859
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Mike,

    Thank you for the details!

    I tried to debug this for over an hour, but I could not find any issues within the search side. The query variables are properly set, even the results in the query are correctly passed and set, there are no duplicates in the final results.
    Somewhere along the ECS the duplication happens – try checking the settings there, something along custom query arguments or similar, those should affect the final outcome.

    I tried to inspect their source code, but I am not familiar with those internal workings, so I could not figure out where the issue might be.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #37860
    mckots87
    mckots87
    Participant

    Thank you for your help. So do you think it is a ECS issue, not Elementor? I appreciate it because if I cannot figure it out in settings I’m going to contact their support.

    Mike

    #37864
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    That is much more likely, pure Elementor is working fine on our ends.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #38451
    mckots87
    mckots87
    Participant
    You cannot access this content.
    #38457
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    That’s a bummer.

    Anyways, I figured out a very simple hacky solution. I don’t know how effective this is going to be, or how long is usable though. Basically a small custom code, which triggers whenever ajax search pro finishes with the results. When it triggers, it fetches the items, and hides the very first one – and that’s it.

    add_action('wp_footer', 'asp_custom_footer_script', 99999);
    function asp_custom_footer_script() {
    	?>
    	<script>
    	(function($){
    		$('.asp_m_1').on('asp_elementor_results', function(){
    			$($('.asp_es_1 .elementor-post').get(0)).css('display', 'none');
    		});
    	}(WPD.dom));
    	</script>
    	<?php
    }

    Try adding this code to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.

    Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #38459
    mckots87
    mckots87
    Participant

    Ernest, as far as I can tell this works perfectly! I cannot thank you enough for this! You are the man, thank you, thank you, thank you!

    Hopefully it lasts forever hahah. I really appreciate it again!!!

    Mike

    #38460
    Ernest Marcinko
    Ernest Marcinko
    Keymaster
    You cannot access this content. Best,
    Ernest Marcinko

    If you like my products, don't forget to rate them on codecanyon :)


    #38461
    mckots87
    mckots87
    Participant

    Of course. Thank you again!

Viewing 11 posts - 1 through 11 (of 11 total)

The topic ‘First item in search results displaying twice’ is closed to new replies.