Wordpress - Images not showing up in the Media Lib

2019-04-04 05:45发布

I have a huge problem with my Wordpress. My uploaded images don't list in the Media Library.

It is weird tho, it says I have 75 images, but display none. Take a look yourself.

75 images, none list

Even weirder, if I go into gallery (the images you uploaded in the page itself), the images list just fine.

I already tried deactivating all my plugins, didn't work. Cache can be easily put out of the question, because it happened on at least 4 different computers, with Macs, PCs, and navigating with Safari, Firefox and Chrome.

Another interesting fact is that if I upload the image directly trough the computer (with the "From Computer" tab), everything goes fine. Another website on the same server works just fine too. And just to add to the complexity, when I go to the media page in the Wordpress Admin, all images show up just fine.

Oh, and before I forget... applying any filters, or doing a research in the media will always come up with the same problem.

So there... that's where I'm at.

11条回答
太酷不给撩
2楼-- · 2019-04-04 06:23

How did you upload those images; via FTP or through WP uploader? You have to upload images THROUGH WP uploader in order to show them in the image library.

查看更多
不美不萌又怎样
3楼-- · 2019-04-04 06:26

Well, Seems like there was a bug when creating custom post types in the function.php file of the theme... which bugged that.

查看更多
来,给爷笑一个
4楼-- · 2019-04-04 06:28

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).

查看更多
做自己的国王
5楼-- · 2019-04-04 06:29

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.

查看更多
闹够了就滚
6楼-- · 2019-04-04 06:32

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.

查看更多
登录 后发表回答