Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Help with search results page › Reply To: Help with search results page
July 26, 2021 at 9:14 am
#34055
Keymaster
That 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)