• Resolved verdisecsolutions

    (@verdisecsolutions)


    I’ve tried just about everything I can think of to change the size of the image in the results pane to show a smaller version of the actual image, but the image is defaulting to one of the “WP generated” images that is a sub-selection of the actual one. How can I override this behavior? I haven’t found where I can “force” a different one to be used in the docs. This is the element in the result pane:

    < span class=”aws_result_image” >
    < img src=”https://www.vinohaus.co/wp-content/uploads/2025/06/2021Cuentavinas-150×150.jpg&#8221; >
    < /span >

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author ILLID

    (@mihail-barinov)

    Hi,

    You can do this via following php code:

      add_filter( 'aws_image_size', function( $size ){
    return 'thumbnail';
    } );

    This force plugin uses thumbnail image size that is by default is 150px X 150px.

    If you need a smaller size – you can add another image name that is smaller ( if you have such a custom one ) or change default thumbnail size via Settings -> Media page. https://prnt.sc/g8JYNDjY2kjx

    Regards

    Thread Starter verdisecsolutions

    (@verdisecsolutions)

    Does this go in the functions.php file or one of the aws ones?

    Thread Starter verdisecsolutions

    (@verdisecsolutions)

    Also, what if I want the image to be a rectangle? Is there anywhere to override the results template format?

    Plugin Author ILLID

    (@mihail-barinov)

    Code snippets must be added into your child theme functions.php file or you can use a special plugin for adding such snippets.

    About rectangle – it all depends on your image size that I mentioned above. You can set a custom image size 50 X 50 for thumbnail size and the plugin will use it.

    Note: that applied only for newly added images. If you need to resize an old image you can use special plugins like this one.

    Thread Starter verdisecsolutions

    (@verdisecsolutions)

    I’m still having problems getting aws to recognize and use the custom image I’m creating with this code:

    add_image_size( ‘aws-custom-wine-bottle’, 30, 90, false );

    // Tell Advanced Woo Search to use it
    add_filter( ‘aws_image_size’, function( $size ) {
    return ‘aws-custom-wine-bottle’;
    });

    The search result pane keeps defaulting back to the square and cropped one. What am I doing wrong?

    Also, I’ve tried regenerating the images several times.

    Thread Starter verdisecsolutions

    (@verdisecsolutions)

    Yeah, this is hardcoded somewhere is aws.

    Plugin Author ILLID

    (@mihail-barinov)

    Please check one more thing – those products that show incorrect images – do they have featured images or images are scrapped from the product content?

    Regards

    Thread Starter verdisecsolutions

    (@verdisecsolutions)

    I figured out the issue. The image optimizer I was using was only creating thumbnails and if the proportionality of the original image was off any a little it would create the thumbnail file and name it with a 48×150 (for example), but apparently the 50×150 (defined as the WP thumbnail size) filename would be referenced when generating the image link on the page.

    I uninstalled the image optimizer, regenerated the thumbnails, and everything worked.

    Thanks for pointing me in the right direction.

    Plugin Author ILLID

    (@mihail-barinov)

    Great! Glad that your issue was resolved.

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Formatting the image size in results pane’ is closed to new replies.