2

I am using Wordpress Skeleton (https://github.com/markjaquith/WordPress-Skeleton) which pulls the themes etc out of the wp directory. I am trying to set it up so uploads have a custom url (eg: site.com/custom/url instead of site.com/uploads).

var_dump(wp_upload_dir()); 

Gives me:

array
    'path' > '/file/system/path/www/wp/core/assets/2014/08'
    'url' > 'http://site.local:8888/wp/core/assets/2014/08'
    'subdir' > '/2014/08'
    'basedir' > '/file/system/path/www/wp/core/assets'
    'baseurl' > 'http://site.local:8888/wp/core/assets'
    'error' > false

The Codex says:

This path can not be absolute. It is always relative to ABSPATH, therefore does not require a leading slash.

Is there any way to remove the wp from the url and baseurl while moving the path to a different directory?

Like this:

array
    'path' > '/file/system/path/www/core/assets/2014/08'
    'url' > 'http://site.local:8888/core/assets/2014/08'
    'subdir' > '/2014/08'
    'basedir' > '/file/system/path/www/core/assets'
    'baseurl' > 'http://site.local:8888/core/assets'
    'error' > false

Note: although they are the same in the example, the path and url may be different ().

EDIT:

I forgot to mention I am currently using this to set the path in wp-config:

define( 'UPLOADS', 'core/assets' );

so I want to remove /wp/ from it (the subfolder where Wordpress is).

  • That define will work to change the upload path. If the problem is that it is going into wp/core/assets, try define( 'UPLOADS', './core/assets' );. You can also get to the root of the site with dirname( __FILE__ ) . '/core/assets' – AJ Zane Feb 4 '15 at 3:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.