Home › Forums › Product Support Forums › Ajax Search Pro for WordPress Support › Change size image › Reply To: Change size image
June 11, 2024 at 9:13 am
#48438
Keymaster
Thank you!
Indeed, the size is not respected in the avatars case, I can confirm this should be adjustable. As a temporary solution I have made a small custom code snippet – but I have noted this on the bug tracker and resolve it for the upcoming release.
add_filter(
'asp_results',
function ( $results ) {
foreach ( $results as $r ) {
if ( $r->content_type === 'user' ) {
$r->image = get_avatar_url(
$r->id,
array(
'size' =>512,
)
);
}
}
return $results;
},
10,
1
);
Try adding this code via the Code Snippets plugin or 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.