image not display in media library and thumbnail not display in post
If you are using custom theme, please add this in the functions.php: add_theme_support( ‘post-thumbnails’ );
If you are using custom theme, please add this in the functions.php: add_theme_support( ‘post-thumbnails’ );
This will not work the way you are thinking. WordPress will try to upload attachments (images, pdfs, etc) to your server using the UPLOADS constant, this path is a file path, local to the server. If you wish to use a CDN you can get a CDN service to do this (manage files and upload … Read more
Looks like I was using this class to do this: http://gravitywiz.com/rename-uploaded-files-for-gravity-form/ and added the filter in myself after line 207, ie. // replace merge tags $form = GFAPI::get_form( $entry[‘form_id’] ); $value = GFCommon::replace_variables( $value, $form, $entry, false, true, false, ‘text’ ); // MOD: add a filter here to hook into filename change $value = apply_filters(‘gravity_forms_upload_filename’, … Read more
Thanks to @Kaperto, I found a .htaccess file in uploads folder and deleted that. Fortunately after that most of my images were back and the site started to work again. The loss of my data was less than 10 images, so I uploaded them again. Everything’s fine now. Still don’t know how the problem happened … Read more
You could look here https://www.digitalocean.com/community/questions/wordpress-the-uploaded-file-could-not-be-moved-to-wp-content-uploads for some good answers.
To begin with you need to add the file as a post meta field, and on your backend – a meta box with a js calling the file uploader. One way of doing this is with the plugin Advanced Custom Fields can do this. ACF – WordPress plugins You can also do it yourself. Try … Read more
The answer actually lies on the same page where you inspected your modifications: /wp-admin/media-new.php. If you get to the /wp-admin/media-new.php file, you will get a function: <?php media_upload_form(); ?> And the function is located in /wp-admin/includes/media.php, where you will get the following line: $max_upload_size = wp_max_upload_size(); So the holly grail you are searching is: wp_max_upload_size(). … Read more
With help from @simongcc and https://fancythemes.com/fix-image-upload-issue-wordpress I’ve found that the Settings > Media > Store uploads in this folder value was not correct and after updating with the correct path I was able to successfully upload pictures.
media_handle_upload() returns Specified file failed upload test
Restrict Users to Only Edit Media Owned by Users in Their Role