C
C
chelnokov_a2020-09-20 15:51:26
WordPress
chelnokov_a, 2020-09-20 15:51:26

How to display full image of woocommerce category?

Hello. When displaying categories in the catalog, a thumbnail image of the category 150-150 is displayed. Is there anything I can do to display the full image?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Anton Litvinenko, 2020-09-20
@chelnokov_a

In general, in the settings of the wokomers in the customizer, you can set the sizes and images on the product page and on the archive page and the aspect ratio.
But as an option it is possible through the filter

add_filter( 'subcategory_archive_thumbnail_size', function( $size ) {
  if ( function_exists( 'is_product_category' ) ) {
    return 'full';
  }
  return $size;
} );

A
Artem Zolin, 2020-09-20
@artzolin

What function are you outputting? See the documentation for it
. For example, the second argument to the function wp_get_attachment_image()is the size of the file as a string thumbnail, medium, large, or full. By default, the size is just equal to the thumbnail, it is 150x150

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question