WP Media Library Grid View not displaying

Found this question: WordPress: media library grid mode infinite loading

And, more recently:
“Currently I am using Enfold child theme but media grid view is not working. Even if I try to get to the grid from any of other places like selecting the featured image its not working.”
From: WordPress grid media is not working

Read More

I am having the exact same problem in WordPress (and also using Enfold). I have renamed my plugins folder to plugins.hold, disabling all plugins. I also set the theme to TwentySixteen. Neither of those things worked. The media library list view works — only the grid view does not. (But, this is vital, since several elements pull the grid view by default with no chance to switch to the list view. This essentially renders those elements useless, as it is impossible to add an image.)

I realize this is more a WP question than a programming question, but I am hoping someone else has seen this and has a suggestion as to how it can be resolved.

Related posts

Leave a Reply

6 comments

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

    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(depand your wordpress version) 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 changed may be lost.

  2. Solution: Check the admin-ajax.php response, if there are non-json return or invalid json return you should investigate where the extra ajax response come from.

    I had similar issue recently, after inspecting admin page the admin-ajax.php response contain non json response. It is because my client adding extra code in function.php that somehow append inline to the admin-ajax.php response

  3. I had this issue recently and after trying all suggestion following worked for me.

    Add following function in wp-config.php at top most line. If needed after that
    than update permalink once.

    ob_start();
    
  4. For me, this happened after moving my site from an NGINX host to Apache. An old .htaccess file was lurking in the /uploads folder, which blocked access to any file in the uploads folder with a referrer that was not was my site (but, the http version, not the current https version). Because NGINX doesn’t read .htaccess, this was now suddenly preventing images from being shown in the media grid.

    Strangely, the images were showing in the list view. Also, directly requesting images was fine, presumably because that is done without a referrer.

  5. Check the log error file in the wp-admin directory. If the repeating error is something like this

    PHP Warning: ini_set () has been disabled for security reasons in

    So, disable the ini_set function in your Cpanel (php selector> options> disable functions)

    If the php selector option does not appear in your Cpanel, contact your hosting provider to fix this problem

  6. Adding following code to functions.php of theme folder worked for me

     add_action('admin_head', 'my_custom_style'); 
    
        function my_custom_style()
        {
            echo '<style>
        .media-frame.mode-grid .media-toolbar {
            
            height: 60px !important;
        }
      </style>';
        }