WordPress.org

Ready to get started?Download WordPress

Forums

WooCommerce Grid / List toggle
[resolved] List view to show Description rather than excerpt (6 posts)

  1. sparx
    Member
    Posted 1 year ago #

    I am trying to use this plugin to offer a list view that uses the description rather than the excerpt. I have found the code that pulls the excerpt:

    add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_single_excerpt', 5);

    and swapped for:

    add_action( 'woocommerce_after_shop_loop_item', 'the_content', 5);

    Now this works fine and shows the description for the product, BUT it also shows the description on the default grid view, which I do not want - I only want the description on the list view option.

    Any ideas?

    Many thanks in advance.

    sparx

    http://wordpress.org/extend/plugins/woocommerce-grid-list-toggle/

  2. jameskoster
    Member
    Plugin Author

    Posted 1 year ago #

    You'll need to hide the content in grid view. Wrap the content in a div with a unique class IE 'product-content' and add the following css;

    ul.products.grid .product-content { display:none; }
  3. sparx
    Member
    Posted 1 year ago #

    Many thanks, I will try this out and post back here.

    sparx

  4. kenguang@gmail.com
    Member
    Posted 1 year ago #

    Hi, I was wondering how can I include the excerpt/description into grid view? Thanks! I'm using Woostore and woocommerce.

    http://wordpress.org/extend/plugins/woocommerce-grid-list-toggle/

  5. jameskoster
    Member
    Plugin Author

    Posted 1 year ago #

    Remove the following from assets/style.css;

    ul.products.grid div[itemprop="description"] {
      display: none;
    }

    Or over ride it in your theme;

    ul.products.grid div[itemprop="description"] {
      display: block !important;
    }
  6. jwt2030
    Member
    Posted 1 year ago #

    Hello, i am trying to get the product description to show, but not in grid view.

    This Works!
    add_action( 'woocommerce_after_shop_loop_item', 'the_content', 5);

    But i can not get this to work :(

    Wrap the content in a div with a unique class IE 'product-content' and add the following css;

    ul.products.grid .product-content { display:none; }

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.