• Resolved jami23

    (@jami23)


    Hi,

    I use woocommerce and on instant result page I am getting images in thumbnail size and I need show full image size.

    I tried these codes in functions.php and re-indexed, but it does not work

    add_filter('algolia_post_images_sizes', function($sizes) {
        $sizes[] = 'medium';
    
        return $sizes;
    });
    
    and
    
    add_filter('algolia_post_images_sizes', function($sizes) {
        $sizes[] = 'shop_catalog';
    
        return $sizes;
    });

    Can you point me how to set it?

    Thanks

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

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Just to be certain, have you checked your Algolia instance and indexes to see what image sizes have been included in the objects? Or are you just trying to compare by looking at the frontend of the website?

    I’m also seeing a algolia_get_post_images filter that would pass in the completed array of images that you could maybe confirm having the intended image data with. It’s an array that gets added to a given post’s shared attributes.

    Thread Starter jami23

    (@jami23)

    Thanks for reply. I checked only by looking at the frontend. Not sure where to check exactly Algolia instance and indexes. In Index I see this https://prnt.sc/26xm31w
    I am very new to this. Can you point me a little bit.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    The area you’re looking at in the screenshot, which would be from your algolia.com dashboard account would be where you want to check. Most specifically the “images” section towards the bottom of the screenshot. That’ll be where the image data is for what is stored on each indexed item.

    As long as you’re getting that part there made available in algolia, the rest is going to be making use of that information as it gets returned as a search result. For that part, it’ll be making sure the templating/output is set to use the desired image size.

    Thread Starter jami23

    (@jami23)

    Hello Michael,

    thanks for replies. I understand it’s this part https://prnt.sc/Z5cz8CXaejB6 and only thumbnails are indexed. But I don’t know where or with what code I can change it to display only full size image on the instant result page.
    I am not coder and don’t understand it at all to be honest so if you can point me a little bit more detailed.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I copied this snippet from your first reply, and put it into my functions.php file for one of my sites that has our plugin here installed:

    add_filter('algolia_post_images_sizes', function($sizes) {
        $sizes[] = 'medium';
    
        return $sizes;
    });
    

    I then went to the “Search Page” in my WP admin and clicked the “Re-index Search Page Records” button at the top, and once that was done, went to my Algolia dashboard to confirm if I now saw “medium” in the images section. I did indeed.

    https://cloudup.com/cPVdma4kCuU

    Only thing I know for sure is that you’d want to change that medium to be the intended size that you want to show. Once we know we have that much handled, we can move on to this next part, which will include template modification.

    https://github.com/WebDevStudios/wp-search-with-algolia/blob/2.1.0/templates/instantsearch.php#L49-L55

    The spots that look like data.images.thumbnail would need to be updated to match the index you set for the indexing portion. For the sake of my example, I’d want to change it to data.images.medium in both spots that show data.images.thumbnail.

    More general information about template customization will be at https://github.com/WebDevStudios/wp-search-with-algolia/wiki/Customize-Templates

    However, first lets make sure you’re looking at the right indexes and that they have the newly specified image sizes, perhaps following my example at the top including where the function was added, etc.

    Thread Starter jami23

    (@jami23)

    Hello Michael,

    thanks so much for your help. It’s working fine.

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    Awesome to hear.

    Let us know if you need anything else.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Instantsearch page – full image size’ is closed to new replies.