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
March 7, 2022 at 9:42 am
#37065
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.