WordPress (WP) version 3.5 solution to modify the default upload image path


It is believed that all friends who have contacted WP system know that the upload path of the old system is pointing to the WP content directory by default. Friends who have done WP blog should be familiar with the background settings. In the previous version, the default path for uploading media files was modified in settings. However, I found that in the latest version 3.5, this method can no longer be used in background settings. The original version 3.5 of WordPress cancelled the option of modifying the file upload path. How can the latest version of WordPress 3.5 set and modify the image upload path?

In fact, WordPress version 3.5 allows you to set the path of the media file upload directory. The development community thinks that the modification of the directory path of the uploaded file is not a common setting, so it is canceled from the background UI. To modify the path of the media upload file of WordPress, the webmaster only needs to set it in the wp-config.php file. The method is as follows.

First, open the wp-config.php file in the WordPress root directory, and then add the following line to the file (Anywhere):

  define( ‘UPLOADS’, ”.’uploads’ );

Explain the function of this definition. For example, your domain name is xxx.com, so your image upload path is set to XXX. COM / uploads /. Tip: don’t forget the last semicolon (;).

Then save the wp-config.php file. Upload a picture in the background and test it. It’s successful.

Article from http://www.gscpp.net reprint must keep the link!

Recommended Today

Configure Apache to support PHP in the Apache main configuration file httpd.conf Include custom profile in

In Apache’s main configuration file / conf/ http.conf Add at the bottom Include “D:workspace_phpapache-php.conf” The file path can be any In D: workspace_ Create under PHP file apache- php.conf file Its specific content is [html] view plain copy PHP-Module setup LoadFile “D:/xampp/php/php5ts.dll” LoadModule php5_module “D:/xampp/php/php5apache2_2.dll” <FilesMatch “.php$”> SetHandler application/x-httpd-php </FilesMatch> <FilesMatch “.phps$”> SetHandler application/x-httpd-php-source </FilesMatch> […]