admin管理员组文章数量:1289517
For instance,My image url is
.jpg
I want change it to
/wp-content/uploads/2021/07/x-600x600.jpg
Or
/wp-content/uploads/2021/07/x-600x600.jpg.webp
I want to know how to do it in function.php ? Or use a plugin ?
Please HELP THANKS.
For instance,My image url is
https://aa/wp-content/uploads/2021/07/x-600x600.jpg
I want change it to
https://images.s3.us-east-2.amazonaws/aa/wp-content/uploads/2021/07/x-600x600.jpg
Or
https://images.s3.us-east-2.amazonaws/aa/wp-content/uploads/2021/07/x-600x600.jpg.webp
I want to know how to do it in function.php ? Or use a plugin ?
Please HELP THANKS.
Share Improve this question asked Jul 6, 2021 at 7:46 Harvey WangHarvey Wang 32 bronze badges1 Answer
Reset to default 0Most of the cache plugins have built-in CDN settings. If you are looking for a simple solution for the image URL only, you can use CDN Enabler. It is from KeyCDN but you don't have to use KeyCDN for it to work. Simply Write your alternative domain to only use image extensions if you don't want to keep CSS, JS, etc in the subdomain.
If you want to do it by a filter, There are other works like creating an options panel so that you don't have to hardcode the domain, etc.
本文标签: How to change images url in functionphp
版权声明:本文标题:How to change images url in function.php? 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741463230a2380161.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论