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

Reply To: "Thin" Appears in Some Search Results

Home Forums Product Support Forums Ajax Search Pro for WordPress Support "Thin" Appears in Some Search Results Reply To: "Thin" Appears in Some Search Results

#37065
Ernest MarcinkoErnest Marcinko
Keymaster

Hi,

Try adding this code to the functions.php file in your theme/child theme directory – make sure to have a full server back-up first for safety. For more details you can check the safe coding guidelines.

add_filter( 'asp_results', 'aspl_remove_thin', 10, 2 );
add_filter( 'asl_results', 'aspl_remove_thin', 10, 2 );
function asp_hide_by_status( $results, $search_id ) {
	$prefix = 'thin';
	foreach ($results as $k=>&$r) {
		if (substr($r->content, 0, strlen($prefix)) == $prefix) {
			$r->content = trim( substr($r->content, strlen($prefix)) );
		} 
	} 
	return $results;
}

It should hopefully do the trick 🙂 Let me know.