• Hello, Is there’s any way to append cdn.statically.io/img/ to my image URLs in all posts.

    For Example:
    Normal URL: https://www.example.com/wp-content/uploads/2021/09/auto-post-to-facebook-from-WordPress-thumb.png

    Appended Url: https://cdn.statically.io/img/www.example.com/wp-content/uploads/2021/09/auto-post-to-facebook-from-WordPress-thumb.png

Viewing 2 replies - 1 through 2 (of 2 total)
  • use

    function change_image_url( $image, $attachment_id, $size, $icon ){
        $otherthumb = str_replace("https://", "https://cdn.statically.io/img/", $image[0]);
        return $otherthumb;
    }
    add_filter( 'wp_get_attachment_image_src', 'change_image_url', 10, 4 );

    Hope this help!

    Thread Starter Mrskt

    (@mrskt00)

    @sanchitvarshney It’s not working, please check your code

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Append external domain to Image URLs’ is closed to new replies.