admin管理员组文章数量:1122826
When I click on "Edit" for an image I see the editor and I see the thumbnails on the right, WordPress just won't show me the actual image in the main area.
/wp-admin/admin-ajax.php?action=imgedit-preview&_ajax_nonce=de68a01318&postid=29499&rand=385 (couldn't not find image)
Here is what I have done to try to fix it:
- Turned off all plugins.
- Remove my own theme and changed to default theme.
- Removed all blank lines and whitespaces in
/wp-content/themes/name/functions.php
+ the including files. - Checked that
php5-gd
is installed. - Permissions changed to
777
for testing/wp-content/upload/
+ sub folders - Removed closing
?>
tags in/wp-content/themes/name/functions.php
+ the including files.
Still no preview displayed. What can be the problem?
When I click on "Edit" for an image I see the editor and I see the thumbnails on the right, WordPress just won't show me the actual image in the main area.
/wp-admin/admin-ajax.php?action=imgedit-preview&_ajax_nonce=de68a01318&postid=29499&rand=385 (couldn't not find image)
Here is what I have done to try to fix it:
- Turned off all plugins.
- Remove my own theme and changed to default theme.
- Removed all blank lines and whitespaces in
/wp-content/themes/name/functions.php
+ the including files. - Checked that
php5-gd
is installed. - Permissions changed to
777
for testing/wp-content/upload/
+ sub folders - Removed closing
?>
tags in/wp-content/themes/name/functions.php
+ the including files.
Still no preview displayed. What can be the problem?
Share Improve this question edited Apr 15, 2019 at 22:15 Sven 3,6641 gold badge34 silver badges48 bronze badges asked Jan 31, 2018 at 14:10 steffanjjsteffanjj 1711 silver badge5 bronze badges5 Answers
Reset to default 5By default, wp-config.php
might not have a closing tag ?>
and this is acceptable and by design. The issue may arise from whitespace in some other .php
file. In my case, I had whitespace after the closing tag of my functions.php
file for my child theme. Once I removed that whitespace, the images are showing up again and I can crop.
The preview is now displayed again after I removed empty lines and whitespaces after ?>
in my wp-config.php
file. That solved the problem.
Make sure that not only wp-config.php
, and functions.php
has no empty lines.
In my case it was one of my custom theme files, which was included with include
PHP function inside of single.php
file.
I found out that in the very beginning of it was few empty lines (before <?php
). Removing them solved the "edit image preview" problem, and WP preview started to show image.
It could be real pain to find such files - so if you have SSH access to that server or have all websites source files downloaded locally and you are on Mac, you can run following terminal commands to find out such files (with empty lines at the beginning/end of files):
- To search and print a list of all PHP files that BEGIN with an arbitrary empty line:
find ./path-to-source-directory -name "*.php" -type f -size +0 -exec gawk 'STARTFILE{if ($0 == "") print FILENAME}' {} +
- To search and print a list of all PHP files that END with an arbitrary empty line:
find ./path-to-source-directory -name "*.php" -type f -size +0 -exec gawk 'FNR==1{if ($0 == "") print FILENAME}' {} +
I solved this via a CustomPostType issue. If the CPT you make doesn't have Revisions turned on, then preview can't show the ACF changes.
The solution that worked for me I found here: https://wordpress.org/support/topic/could-not-edit-image-unable-to-edit-this-image-localhost/
"Just go to php.ini where xampp is installed, assuming it’s C:\xampp\php by default. Open the file, find the line ;extension=gd and remove that semicolon. Restart xampp server and it should work."
Regards Klaus
本文标签: wp adminEdit image preview is not displayed
版权声明:本文标题:wp admin - Edit image preview is not displayed 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736310618a1934443.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论