Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Result Links to Pages with Permalinks Not Working
This topic contains 3 replies, has 2 voices, and was last updated by Ernest Marcinko 7 years, 3 months ago.
- AuthorPosts
- December 28, 2016 at 7:39 pm #11373
I am using the multisearch feature to return search results for two sites–site A, which contains the search box, and site B. Permalinks for site A are set to Post name. This is required by one of the other plugins I am using. Permalinks for site B are set to Default (page ID).
The search successfully returns results from both sites. When I click links in the results for site A, they work fine; however, when I click links in the results from site B, they just go to site B’s home page. For example, when I click a result with the page name “Working with Themes,” it goes to this URL:
[Help site path]/sample-page/00phoenix-working-with-themes/
The correct URL is [Help site path]/?page_id=4093
If I change site A’s permalink settings to Default (page ID), everything works fine; however, I am unable to do this because of the other plugin that requires Post name for permalinks.
Please advise.
December 29, 2016 at 11:03 am #11401Hi,
Interesting, looks like WordPress returns urls depending on how the currently active site is configured. This might be a core bug, as the get_permalink($id) call is used by ajax search pro to always get the correct links.
I believe the best solution is to create filter to change the permalink in the results if the [Help site path] is detected in the URL pattern. I would recommend trying this code:
Change the $url variable value to the help site url. If it’s detected in the final url, this snippet will try to change it to the regular non-permalink URL.
Best,
I haven’t had a chance to test this code, so please be careful when editing the files.
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
December 29, 2016 at 7:43 pm #11417Hi, Ernest:
It worked! THANK YOU! I am pleasantly surprised at your helpful and PROMPT response. So appreciate your time.
Regards, Stephanie
December 29, 2016 at 7:47 pm #11418You cannot access this content. Best,
Ernest Marcinko
If you like my products, don't forget to rate them on codecanyon :)
- AuthorPosts
The topic ‘Result Links to Pages with Permalinks Not Working’ is closed to new replies.