21

我的 Wordpress 有一个很大的问题。我上传的图片未在媒体库中列出。

很奇怪,它说我有 75 张图片,但没有显示。自己看看吧。

75 张图片,无列表

更奇怪的是,如果我进入图库(您在页面本身上传的图像),图像列表就很好。

我已经尝试停用我所有的插件,但没有奏效。缓存可以很容易地排除在外,因为它发生在至少 4 台不同的计算机上,包括 Mac、PC,并使用 Safari、Firefox 和 Chrome 进行导航。

另一个有趣的事实是,如果我直接通过计算机上传图像(使用“从计算机”选项卡),一切都会好起来的。同一台服务器上的另一个网站也可以正常工作。只是为了增加复杂性,当我进入 Wordpress Admin 中的媒体页面时,所有图像都显示得很好。

哦,在我忘记之前……应用任何过滤器,或者在媒体上进行研究总是会遇到同样的问题。

所以那里......这就是我所在的地方。

4

12 回答 12

10

我刚才遇到了同样的问题,我的博客缺少媒体库图像。这些图像似乎就在媒体库中,并且肯定在实际的 Web 服务器上(通过 FTP 检查)。

正如艾伦 Z 建议的那样,我做了“检查设置 → 媒体并确保上传文件文件夹设置为 wp-content/uploads”

Mine were set to the default blank. I altered this to an absolute path http://www.example.com/wp-content/uploads

THIS DIDNT SOLVE THE PROBLEM when I refreshed the site in browser. However, I immediately changed the path back to blank (the default setting again) and everything came back! Woop

Everyone having this problem might want to try this before getting into the more technical fixes!

于 2012-02-01T02:30:00.310 回答
8

it was your permalinks... you must have changed to labeled-name... switch back to default.

that worked for me.

于 2014-01-14T21:34:53.983 回答
6

检查屏幕选项(页面右上角的下拉选项卡),并确保对屏幕上显示的内容进行了合理的设置。应检查所有列设置,并且屏幕上应显示正数的媒体项目。

如果没问题,请检查设置 → 媒体并确保上传文件文件夹设置为wp-content/uploads.

我相信这些是唯一可以从管理屏幕更改的设置。

于 2011-12-08T22:05:52.620 回答
6

Here's something a guy on Wordpress forum showed us. Add the following to your functions.php file. (remember to create a backup of your functions.php first)

add_filter( 'wp_image_editors', 'change_graphic_lib' );
function change_graphic_lib($array) {
  return array( 'WP_Image_Editor_GD', 'WP_Image_Editor_Imagick' );
}

...it was that simple.

于 2014-06-15T22:19:23.337 回答
5

好吧,似乎在主题的 function.php 文件中创建自定义帖子类型时存在错误......这导致了错误。

于 2011-12-09T21:04:33.197 回答
5

I had this problem with wordpress 3.8.1 and it turned out that my functions.php wasn't saved as utf-8. Re-saved it and it

于 2014-01-29T22:41:19.300 回答
4

I faced same issue on my wordpress site. After the lot of debugging i fixed my problem step by step like this.

  1. First add given below code your db-config.php
define('SCRIPT_DEBUG', TRUE);
define('WP_DEBUG', TRUE);
define( 'WP_DEBUG_LOG', true );
  1. Then goto /wp-includes/js/wp-util.js files and find the code $.ajax( options ) on line number 100 insert given below code into your file
deferred.jqXHR = $.ajax( options ).done( function( response ) {
  try {
      response = JSON.parse(response);
  } catch (Exception) {
      response = response;
  }

Please check your may be resolved.

  1. if you Removed constant from db-config.php
define('SCRIPT_DEBUG', TRUE);
define('WP_DEBUG', TRUE);
define( 'WP_DEBUG_LOG', true );   
  1. Then compress your /wp-includes/js/wp-util.js file code and put your compressed code into /wp-includes/js/wp-util.min.js

*change your own risk if your update your wordpress version your changed may be lost.

于 2017-06-01T06:34:19.273 回答
3

你是如何上传这些图片的;通过 FTP 还是通过 WP 上传器?您必须通过 WP 上传器上传图像才能在图像库中显示它们。

于 2011-12-09T12:39:18.887 回答
3

考虑到文件不是通过媒体上传器上传的,它们存在于服务器中,但在您的数据库中没有对它们的引用(更详细一点)。

为了修复它,请安装Media Sync 插件。一旦它处于活动状态,在媒体 > 媒体同步 > 扫描文件下,然后通过单击它们旁边的复选框来选择要导入的文件。确保还取消选中选择框Dry Run (test without making database changes)

然后,当您准备好时,只需单击“Import Selected”,您应该会看到类似这样的内容

媒体同步导入图像

完成后,您可以访问媒体 > 库,您将在那里看到所有导入的文件。

于 2020-03-10T19:08:56.673 回答
2

Did you ever change the directory of your Wordpress install?

I had a problem with not finding my uploaded images after changing the Wordpress location on my server. In Wordpress, I went to Dashboard-> Settings -> Media and changed the uploads folder in the "Store uploads in this folder" field.

于 2016-02-26T19:25:04.233 回答
2

Ubuntu stores uploads in /var/lib/wordpress/wp-content/uploads . So what you need is to have this directory within your wordpress installation. Something like:

sudo ln -s /var/lib/wordpress/wp-content/uploads /var/www/www.mysite.com/wp-uploads

(replace mysite.com with your domain, the file should exist) should do the trick.

(Note that I've not tested this with multiple wordpress installations on one server.)

Further note that to make upload work at all (but this wasn't the question), you need to change Settings / Media / Store uploads in this folder to

 wp-content/uploads

(no leading slash).

于 2016-05-13T18:52:43.087 回答
2

check .htaccess file in root of wordpress, maybe there is a rule for /uploads directory. if so, remove it. but be careful and check which plugin did it, so disable the plugin, first.

于 2019-01-06T06:08:31.930 回答