Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Different Types on multisite › Reply To: Different Types on multisite
July 7, 2020 at 3:06 pm
#28285
Keymaster
Hi Till,
Well, not possible via settings, but it might be possible via custom coding. 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( 'asp_results', 'asp_attachment_image_custom', 10, 1 );
function asp_attachment_image_custom( $results ) {
// Parse through each result item
foreach ($results as $k=>&$r) {
// PDF custom image
if ( isset($r->post_mime_type) && strpos(strtolower($r->post_mime_type), 'pdf') !== false ) {
$r->image = 'https://archiv.njf.de/wp-content/plugins/download-manager/assets/file-type-icons/pdf.svg';
}
}
return $results;
}