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

    (@tw2113)

    The BenchPresser

    Hi there,

    Probably the best/easiest way to go about this, if wp_get_attachment_image_src() isn’t finding the intended URL permalinks, is going to be overriding the images attribute before an item is indexed.

    Ignore the part about this link below saying ACF, the hooks and callback are the important part, as it’s still a valid spot to intercept things at

    https://github.com/WebDevStudios/wp-search-with-algolia/wiki/Advanced-Custom-Fields

    Based on what I can see, around line 220 of includes/indices/class-algolia-posts-index.php and line 214 of includes/indices/class-algolia-searchable-posts-index.php the filters in question would get a variable named $attributes from the wiki page code, and in that would be $attributes['images'] that you could mimick Algolia_Utils::get_post_images( $post->ID ) with and pull your desired CDN copies instead.

    Thread Starter popeating

    (@popeating)

    Thank you for your reply,
    i tried to modify the class but it looks like the
    get_the_post_thumbnail_url
    function inside the plugin return a different value than inside a template
    In my template it returns the CDN url
    in the plugin it returns the local url

    quiete puzzled about it
    i can probably do some text replacement but i dont really like to hardcode this stuff

    Plugin Contributor Michael Beckwith

    (@tw2113)

    The BenchPresser

    I’m not saying to to modify the class and method itself, just mimic it within your own code area, create a function that returns the CDN urls instead, and push them into the attributes that eventually get sent to Algolia.

    At least based on what I was able to see in our code, this would be the best option to amend the image paths indexed.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Not generating thumbnail’ is closed to new replies.