Result Links to Pages with Permalinks Not Working

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 Ernest Marcinko 7 years, 3 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #11373
    sschoch
    sschoch
    Participant

    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.

    #11401
    Ernest Marcinko
    Ernest Marcinko
    Keymaster

    Hi,

    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.
    I haven’t had a chance to test this code, so please be careful when editing the files.

    Best,
    Ernest Marcinko

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


    #11417
    sschoch
    sschoch
    Participant

    Hi, Ernest:

    It worked! THANK YOU! I am pleasantly surprised at your helpful and PROMPT response. So appreciate your time.

    Regards, Stephanie

    #11418
    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 :)


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

The topic ‘Result Links to Pages with Permalinks Not Working’ is closed to new replies.