Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Search by custom post type
- This topic has 12 replies, 2 voices, and was last updated 2 years, 9 months ago by
Ernest Marcinko.
-
AuthorPosts
-
September 4, 2023 at 1:20 pm #45213
Valentina Ravasi
ParticipantI 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,
ValentinaSeptember 4, 2023 at 4:06 pm #45218Ernest Marcinko
KeymasterHi 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 🙂
September 5, 2023 at 7:08 am #45225Valentina Ravasi
ParticipantNow you can check, it’s all ok.
thank you,
ValentinaSeptember 5, 2023 at 1:51 pm #45233Ernest Marcinko
KeymasterThank 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!
September 5, 2023 at 2:16 pm #45238Valentina Ravasi
ParticipantYou cannot access this content.
September 5, 2023 at 2:22 pm #45240Ernest Marcinko
KeymasterThank 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
September 6, 2023 at 8:02 am #45251Valentina Ravasi
ParticipantYou cannot access this content.
September 6, 2023 at 11:27 am #45254Ernest Marcinko
KeymasterIt 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.pngSeptember 6, 2023 at 12:44 pm #45257Valentina Ravasi
ParticipantYou cannot access this content.
September 6, 2023 at 1:05 pm #45259Ernest Marcinko
KeymasterHi 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.
September 7, 2023 at 8:57 am #45277Valentina Ravasi
ParticipantYou cannot access this content.
September 7, 2023 at 11:43 am #45282Valentina Ravasi
ParticipantYou cannot access this content.
September 7, 2023 at 1:36 pm #45286Ernest Marcinko
KeymasterWait 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.
-
AuthorPosts
- You must be logged in to reply to this topic.