Viewing 15 replies - 1 through 15 (of 25 total)
  • Thread Starter timsilva_

    (@timsilva_)

    Has no one else experienced issues with defining a custom uploads directory?

    Plugin “WordPress Popular Posts” use?

    Thread Starter timsilva_

    (@timsilva_)

    Hey Sergey, glad to hear I’m not alone on this. I’ve been searching around all over with no luck.

    In the worst-case scenario we could revert back to the default location for all hard-coded images, but that’s obviously lots of manual work, and even the automated steps (find all and replace all) might not always be the safest…

    I am juggling lots of work today, but if I stumble across any solution I will let you know. In the meantime, hopefully some others with the same issue come forward so we can have more minds on it.

    I deactivated plugin WordPress Popular Posts and everything was good.
    (Sorry for my English)

    The same problem here =(

    Thread Starter timsilva_

    (@timsilva_)

    I don’t have the “WordPress Popular Posts” plugin installed, but I haven’t tried to disable plugins yet. I’m currently in the middle of some database work, so I’ll try that when I get a chance and see if one of my plugins is causing the issue.

    @skanslie – Do you have the “WordPress Popular Posts” plugin installed too?

    Nope i dont

    The problem in some plug-in

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    …when placed directly after…
    require_once(ABSPATH . ‘wp-settings.php’);

    Because that is the wrong place to put it in the wp-config.php file.

    All “defines” should be at the top of the file. Including the “wp-settings.php” file is the last line of wp-config.php. It’s the line that loads WordPress. Any defines made after this line will have no effect, because you’re defining them after you have already loaded and ran the WordPress process.

    Put your defines first, like the wp-config-sample.php file demonstrates.

    Thread Starter timsilva_

    (@timsilva_)

    @otto42 – Thanks for the suggestion Samuel! I’ll give that a try ASAP. ??

    I found the original tutorial that I learned about this from: https://www.hongkiat.com/blog/wordpress-custom-upload-dir/ As you can see, they instructed to place the “Define” line after the require_once. For some strange reason, this was working for me (and others apparently) before. As soon as I confirm that your solution works, I will report back.

    In the meantime, if anyone else has success (or not) with Samuel’s idea, let us know!

    Moderator Samuel Wood (Otto)

    (@otto42)

    www.ads-software.com Admin

    Yeah, no define after that line will ever work. The tutorial is just wrong.

    The other methods it mentions about setting the value in the options table will indeed work though. But you don’t need both methods.

    Thread Starter timsilva_

    (@timsilva_)

    @otto42 – I owe you a beer my friend, thank you SO MUCH for noticing that tiny detail. You were 100% correct about my error. I moved the define uploads code up after the other defines, and it fixed the problem immediately!

    Somehow, the old method was working for a long time. Unless I somehow moved the code at some point, but from what I can tell it has been that way for at least 6 months.

    Hopefully that fixes the problem for other users.

    Cheers,
    Tim

    If you’re on Multisite, check the Upload Path and Fileupload Url settings in Network -> Sites -> Edit -> Settings

    source: https://www.ads-software.com/support/topic/subdomain-multisite-correct-settings-for-upload-url-path?replies=8#post-4670992

    timsilva_ Is this problem was resolved? Can you please guide me to resolve the same problem?

    Thread Starter timsilva_

    (@timsilva_)

    @vstamilan The cause of my problem was that I placed this code:

    define('UPLOADS','files');

    in the wrong part of wp-config.php – I place it after:

    require_once(ABSPATH . 'wp-settings.php');

    when it should have been at the top of the document with the other define statements. (Because I followed the old HontKiat tutorial that gives incorrect instructions)

    If that isn’t what caused your problem, then I’m not sure what did create the issue on your unique site. Maybe someone else here can help you identify what went wrong.

Viewing 15 replies - 1 through 15 (of 25 total)
  • The topic ‘Defining custom uploads directory is broken in WP 4.5 (wp-config)’ is closed to new replies.