Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Problems with external links assearch results
This topic contains 1 reply, has 2 voices, and was last updated by Ernest Marcinko 3 weeks, 2 days ago.
- AuthorPosts
- January 9, 2023 at 9:39 am #40815
Hi all, I use ajax search pro on my website http://www.wohlsein24.de
There is also database with “links” / urls that I use for a search.
The results looks good, but the “links” of the url all damage.Example…. I search for hypnose and get a result of an external link to:
https://www.deutscherhypnoseverein.de/but the link I follow with a klick on the results looks like this:
https://wohlsein24.de/wplp_link/https-www-deutscherhypnoseverein-de/or a more komplex link like this:
will be linked to
https://wohlsein24.de/wplp_link/https-www-apotheken-umschau-de-podcast-serie-the-sex-gap-der-podcast-zu-geschlechtergerechter-medizin-908563-html/you can try it with a look to this resultpage:
https://wohlsein24.de/?s=apo&asp_active=1&p_asid=1&p_asp_data=1&filters_initial=1&filters_changed=0&qtranslate_lang=0¤t_page_id=75what can I do to fix this?
January 9, 2023 at 1:48 pm #40821Hi,
Well, the plugin can not affect how the links work especially not on the results page, this might be a theme related issue – although I am not exactly sure about that either.
Depending on how these custom links are added, the template very likely prints them via the get_permalink, call. However these links are changed, there should be a hook added somewhere to this core WordPress function to change the permalink accordingly.
In your case the title seems to be the link URL, so something like this could maybe do the trick:
add_filter('post_link', 'asp_add_post_link', 10, 3); function asp_add_post_link( $permalink, $post, $leavename ) { $title = get_the_title($post); if ( strpos($title, 'https://') ) { return $title; } return $permalink; }
This is just a wild guess though.
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.