The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

WooCommerce Grid / List toggle
[resolved] Hide excerpt text on grid view? (4 posts)

  1. ignaziolaci
    Posted 3 years ago #

    I'm very happy with the plugin the only thing I can't figure out is how to I hide the excerpt text in grid view?


    The funny thing is that after toggling back and forth between grid and list that text goes away..


    But I'd like that to be always hidden in grid view, not only if i toggle back an forth grid/list.

    Any suggestion is greatly appreciated!


  2. skyrocker_ss
    Posted 3 years ago #

    i ran into this as well, and since the author hasn't responded to your post, i decided to look under the hood. i resolved this by modifying the jquery.gridlistview.min.js inside plugins/woocommerce-grid-list-toggle/assets/js

    this is my modified version of this file (replace it all and it should work):

    // The toggle
    function startAsGrid(){
    		jQuery('ul.products').fadeOut(0, function() {
    		return false;
    jQuery("#grid").click(function(){jQuery(this).addClass("active");jQuery("#list").removeClass("active");jQuery.cookie("gridcookie","grid",{path:"/"});jQuery("ul.products").fadeOut(300,function(){jQuery(this).addClass("grid").removeClass("list").fadeIn(300)});return!1});jQuery("#list").click(function(){jQuery(this).addClass("active");jQuery("#grid").removeClass("active");jQuery.cookie("gridcookie","list",{path:"/"});jQuery("ul.products").fadeOut(300,function(){jQuery(this).removeClass("grid").addClass("list").fadeIn(300)});return!1});jQuery.cookie("gridcookie")&&jQuery("ul.products, #gridlist-toggle").addClass(jQuery.cookie("gridcookie"));if(jQuery.cookie("gridcookie")=="grid"){jQuery("#gridlist-toggle #grid").addClass("active");jQuery("#gridlist-toggle #list").removeClass("active")}if(jQuery.cookie("gridcookie")=="list"){jQuery("#gridlist-toggle #list").addClass("active");jQuery("#gridlist-toggle #grid").removeClass("active")}jQuery("#gridlist-toggle a").click(function(e){e.preventDefault()})});

    all I did was replicate the function that activates the grid view, into a new function called startAsGrid(), and just fire it up first, so the grid view gets selected when entering the page the first time. the reason the plugin doesn't hide the short description when you first go in is because it hasn't been selected yet. So with this function, it just selects it automatically when entering the page.

    Hope this helps while the author updates his source code.

  3. James Koster
    Plugin Author

    Posted 3 years ago #

    An easier alternative would be to add the following line directly after jQuery(document).ready(function(){:


    Which will add the grid class on initial page load. It might interfere with the cookie but I'm not sure without testing.

  4. skyrocker_ss
    Posted 3 years ago #

    I think I tried it that way, but it didn't work (at least for me), which is why I decided to replicate the function instead and fire it on page load.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WooCommerce Grid / List toggle
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic