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

Reply To: Problems with search links

#28333
Ernest MarcinkoErnest Marcinko
Keymaster

Hi,

Thanks for the details, it helps a lot! You have the following custom code in your theme functions.php:

add_filter( 'asp_results', 'asp_custom_link_meta_results', 10, 1 );
function asp_custom_link_meta_results( $results ) {
    // Change this variable to whatever meta key you are using
    $key = 'wprss_item_permalink';

    // Parse through each result item
    foreach ($results as $k=>$v) {
        if ( function_exists('get_field') )
            $new_url = get_field( $key, $v->id, true ); // ACF support
        else
            $new_url = get_post_meta( $v->id, $key, true );

        // Change only, if the meta is specified
        if ( !empty($new_url) ) {
            $results[$k]->link = $new_url;
        }
    }

    return $results;
}

This modifies the search results link to the wprss_item_permalink custom field value. Removing the custom code will resolve the issue.