This website uses cookies to personalize your experience. By using this website you agree to our cookie policy.

Reply To: Help with search results page

#34055
Ernest MarcinkoErnest Marcinko
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)