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

Reply To: Quickfinders among search results

Home Forums Product Support Forums Ajax Search Pro for WordPress Support Quickfinders among search results Reply To: Quickfinders among search results

#28024
Ernest MarcinkoErnest Marcinko
Keymaster

Well, that the plugin cannot affect unfortunately. Looks like that post type stores the URL in a custom field or somewhere else, however WordPress will always display the original permalink.
Form the page editor, it looks like the custom field is thegem_quickfinder_item_data

You can try a custom code, but you might have to ask the theme/plugin author as well, which implements this post type, to suggest how to get the correct URL.
Try adding this custom code to the functions.php in your theme/child theme directory. Before editing, please make sure to have a full site back-up just in case!

add_filter('post_type_link', 'asp_get_link_cf', 9999999999, 2);
function asp_get_link_cf( $url, $post ) {
	$data = get_post_meta($post->ID, 'thegem_quickfinder_item_data', true);
	if ( !empty($data) ) {
		$data = maybe_unserialize($data);
		if ( isset($data->link) ) {
			return $data->link;
		}
	}
        
	return $url;
}

This may not work, but should be close to a possible solution.