Is there any experience with Woocommerce Grid / List view plugin, I set to automatically start the list view but the problem is that while the page is loading initially opens a grid view and instantly change to list view, it takes 1 second but it seems confusing.Is there any idea how it could be resolved?
I took the code from the following link
jQuery(document).ready(function(){
jQuery('ul.products').addClass('list');
});
Undo any changes you’ve have made to the file, then add this at the top:
Update: Sounds like a FOUC. Let’s take a different approach – remove the code you added above & try adding the following to your theme’s
functions.php
:This will add the grid/list class to the product list immediately after it enters the document (as opposed to waiting for document ready).