Search by custom post type

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Search by custom post type

This topic contains 12 replies, has 2 voices, and was last updated by Ernest Marcinko Ernest Marcinko 5 months, 2 weeks ago.

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #45213
    Valentina Ravasi
    Valentina Ravasi
    Participant

    I put a search bar in the website header.

    In the search results, as you can see from the screenshot, I have also inserted the custom post type “traguardi di competenza”. But it does not work.
    How can I do?

    you can access to website with a temporary login – admin username: [email protected]

    Thank you,
    Valentina

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

    Hi Valentina,

    Thank you very much for the details. I tried to check, but currently I am getting a database issue when trying to view the site: https://i.imgur.com/AfSgRkq.png

    Please let me know once it’s resolved and I will check again 🙂

    Best,
    Ernest Marcinko

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


    #45225
    Valentina Ravasi
    Valentina Ravasi
    Participant

    Now you can check, it’s all ok.

    thank you,
    Valentina

    #45233
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Thank you!

    Can you please tell me how can I access the admin interface? I only see a username, but no password. I checked my mailbox if you sent me any links or one time login queries, but I can’t find any. Can you please let me know the login/pass? Thanks!

    Best,
    Ernest Marcinko

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


    #45238
    Valentina Ravasi
    Valentina Ravasi
    Participant
    You cannot access this content.
    #45240
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Thank you, that worked!

    I logged in, and I found one major issue, that the primary results ordering was set to Title descending so the relevance was ignored. This way results were not ordered by the relevance and the results were seemingly “missing”, when in fact they been only further down the list.

    I changed it back to the default relevance option, now if I search for example “IRE” I get results as expected: https://i.imgur.com/qwtIm5G.png

    Best,
    Ernest Marcinko

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


    #45251
    Valentina Ravasi
    Valentina Ravasi
    Participant
    You cannot access this content.
    #45254
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    It is because those fields are not actually the post description, but custom fields. I have selected them for you in the search settings: https://i.imgur.com/kIwE7Ac.png

    I have also made that field as the scondary post description field, in case the actual description field is empty: https://i.imgur.com/T2TeuES.png
    Now searching the items will also display the description as expected: https://i.imgur.com/8y8u5pg.png

    Best,
    Ernest Marcinko

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


    #45257
    Valentina Ravasi
    Valentina Ravasi
    Participant
    You cannot access this content.
    #45259
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi Valentina,

    It is because after filtering a hook is triggered to initialize the posts element. I guess that somehow interferes with the lightbox in some way. It is hard to tell if this is possible to solve, but some custom code may be needed.

    Try adding this code via the Code Snippets plugin or 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.

    add_action('wp_footer', 'asp_add_footer_script', 99999);
    function asp_add_footer_script() {
    	?>
    	<script>
    	window.addEventListener('load', () => {
    		WPD.Hooks.addFilter('asp/live_load/start', function(){
    			WPD.Hooks.removeFilter('asp/live_load/finished');
    		}, 10);
    	});
    	</script>
    	<?php
    }

    If all goes well, then this may do the trick.

    Best,
    Ernest Marcinko

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


    #45277
    Valentina Ravasi
    Valentina Ravasi
    Participant
    You cannot access this content.
    #45282
    Valentina Ravasi
    Valentina Ravasi
    Participant
    You cannot access this content.
    #45286
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Wait a second then – it’s actually the previous code suggested causing the issue! I didn’t remember the ticket, thank you for reminding.

    I’m afraid it’s not possible to resolve both cases at the same time. The accordion requires the widgets to initialize, but then if the widgets initialize it will break the image lightbox – it’s sort of a catch 22 situation.

    Best,
    Ernest Marcinko

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


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

You must be logged in to reply to this topic.