Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Help with search results page
This topic contains 9 replies, has 2 voices, and was last updated by Ernest Marcinko 1 year, 8 months ago.
- AuthorPosts
- July 22, 2021 at 3:41 pm #34029
Hi,
I have a search bar on the home page of the above website. The functionality we needed form your plugin was the ability to search within a PDF, so I basically disabled most of the ajax features. It is now operating like a “normal” search. After adding a term and clicking “search” you are taken to a page of results which I have customized using the Divi Theme Builder. The problem that I am running into is when you click a results link, you are taken to a default blog post page with a comment section. If you click the title link from that new the page, the pdf opens. I need to cut out that second step since it is totally confusing.
What I’d like to accomplish is when someone searches, they are taken to the results page. Clicking the results link opens the PDF in a new window. In the settings, under attachments, I have set: “Link the results to attachment file directly”, but that doesn’t help. I reached out to my programmer who tried some of your hooks and filters, but they don’t seem to work, at least with Divi.
Thank you for your help,
KimiJuly 22, 2021 at 3:44 pm #34030I have more information that might be helpful. My programmer said:
By the way, this is the filter I was trying to use. https://knowledgebase.ajaxsearchpro.com/hooks/filters/search-results/asp_attachment_results
But when I used it in the code snippet plugin the results would not change. I tried changing the title and link, but nothing changed. However when I returned a blank in the function the search results page would show that no results were found, so that was strange.
Thank you,
KimiJuly 23, 2021 at 12:39 pm #34040Hi Kimi,
Well, all the plugin does is send the results to the results page, the rest is up to the theme unfortunately. While it forces the same URL to the results page, ulitmately the results page handler decides what is going to be displayed there.
Can you please try this custom code maybe:
add_filter( 'asp_regular_search_result', 'asp_force_guid', 10, 2 ); function asp_force_guid( $post, $result ) { $post->guid = $result->link; $post->asp_guid = $result->link; return $post; }
There is a very small chance this is going to work, but it is worth a try.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
July 23, 2021 at 2:47 pm #34045Unfortunately, that did not help as you suspected. Can you explain the option under attachments to “link to attachment file directly”. I have that option selected and thought that would open the pdf.
Kim
July 23, 2021 at 2:51 pm #34046I’m sorry, I had one more question. While we are testing the search, we only uploaded 3 pdf’s. When searching for a term that we know is included in all three documents, the results are only showing one. Could you help with a possible explanation? We are using the table index.
Thanks again!
KimiJuly 26, 2021 at 9:14 am #34055That option works for the live search results for sure. For the results page it is a bit more compicated, as plugins have very limited control over it. WordPress tends to fetch the URLs, and in many cases it is very hard to override that.
Hi, there is still hope, maybe this variation:add_filter( 'asp_regular_search_result', 'asp_force_guid', 10, 2 ); function asp_force_guid( $post, $result ) { if ( $results->post_type == 'attachment' ) { $post->guid = wp_get_attachment_url( $result ->id ); $post->asp_guid = wp_get_attachment_url( $result ->id ); } return $post; }
If all goes well, this will force the final URLs to the direct attachment links.
As for the index, try recreating the index table, to make sure the files were picked up by the plugin. (under the Index Table options)
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
July 27, 2021 at 8:45 pm #34072Hi, I tried adding that snippet, but it did not work either, It doesn’t appear that the plugin will work properly with our theme. Is it possible to get a refund?
Thank you,
KimJuly 28, 2021 at 8:05 am #34074You can open a refund request here: https://help.market.envato.com/hc/en-us/articles/202821460-Can-I-Get-A-Refund-
It is however very unlikely it is getting approved, as the issue is not directly caused by the plugin. If you want, you can add temporary FTP access, and I can try tweak the code more though.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
July 28, 2021 at 2:55 pm #34080We have found another plugin that is working more closely to what we need and the developer is helping tweak it for us. I’ll just keep your plugin and hopefully be able to use it in the future for another client. You might add to your documentation somewhere that the plugin is not compatible with Divi. It is not something I would have known without trying it first.
Thanks,
KimJuly 29, 2021 at 12:58 pm #34093Hi Kim,
Thank you for the feedback. It should be okay with any theme out there, including Divi, as usually high quality themes follow the WordPress development guidelines. I’m almost positive it should still work, unless Divi does some weird stuff (which I doubt). It could be a conflict with something else as well, but I can’t tell without going through the code directly. If you want, I can take a direct look at the code and debug it. For that please add temporary FTP access.
Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
You must be logged in to reply to this topic.