The reason for this article is mainly because Cool theme I have made some WP stations use Tencent Cloud COS to store special fee soft coins and it is inconvenient to move and download them. So today, let me teach you how to set your own domain name to store media library pictures!
If you want to better manage the pictures of WordPress website, you can customize and modify the path of uploading pictures of WordPress. First, set the media in the background of the theme
Modify the default file upload path wp content/uploads to the subfolder name img
If you cannot find the above option, you can use the following code to retrieve it
if(get_option('upload_path')=='wp-content/uploads' || get_option('upload_path')==null) { update_option('upload_path',WP_CONTENT_DIR.'/uploads'); }
Then change the full URL of the file to your secondary domain name, such as
//pic.hongchengtech.cn
Finally, it is natural to directly resolve the secondary domain name to the host