New answers tagged

0

You get $sizes as array, where size name is a value, not a key Try this //remove sizes with init hook and remove_image_size add_action('init', function ($sizes) { remove_image_size('2048x2048'); remove_image_size('1536x1536'); return $sizes; }); // or just return sizes you need add_filter('intermediate_image_sizes'...


1

I just ran a test where I uploaded an image to media library, then renamed my root index.php file to break Wordpress, but the image I uploaded was still available by accessing it directly with its wp-content/uploads/... URL. There are no .htaccess files in wp-content or uploads either, which means that, barring any plugins that might do some magic to ...


0

You need to add that line to your wp-config.php. Double check that you put it in the right place. You need to set the permissions on that directory you created so that Wordpress can write to it. This is dependent on how your hosting works and what program you're using, but you should try setting the permissions to e.g. 770, which gives write permission to ...


0

Sorry this isn't a full answer, but yes this probably is possible but you need to run a database query or some code to find the images, and then do something with that list such as copy the files to a new directory. There's info here on how featured images are stored. Here's a quick suggestion based on that post, written as pseudocode, but if it's what you ...


0

if you need for theme you can use my function function file_checker($file){ //http://localhost/wordpress/wp-content/themes/THEMEName $location = get_template_directory_uri();// you can edit this <= $location = str_replace("http://","",$location); $location = str_replace("https://","",$location); $...


0

The same thing happen to me, it was due to some plugins I have installed, I removed all the recently added plugins, then everything worked fine. Still doesn't work then add this line: define( 'UPLOADS', 'wp-content/uploads' ); at the end of the wp-config.php file.


Top 50 recent answers are included