Tagged: catalog, functions.php, image
-
AuthorPosts
-
February 17, 2015 at 3:10 pm #397529
Hi,
we are using WooCommerce and the Enfold Product List option but having trouble getting the product image looking how we want it in the Product List.
The Product List pulls in a 180×180 version of the product image into class=”av-catalogue-item product_type_variable” but we want to display a landscape image instead.
I’ve removed the border radius and originally tried object-fit: which worked a treat until I tested IE which as usual doesn’t support it. (sigh).
Can you advise where in the php I can edit the image being used in your Product list or kindly provide a filter.
Thanks again.
February 17, 2015 at 4:56 pm #397595Update:
In functions.php I have added the following line to register a new image size
$avia_config['imgSize']['catalog']= array('width'=>490, 'height'=>340 ); // images for catalog
Then in config-templatebuilder\avia-shortcodes\productslider.php
I have changed line 358 from “square” to “catalog” and so far it’s all looking ok (apart from the way WordPress has cropped the images but that’s for me to sort).
Now… This all works fine when I edit productslider.php within the Enfold theme structure but if I then try it in my child theme the changes don’t show.
I have the following structure:
Ridelines (theme name)
– functions.php (with the new $avia_config[‘imgSize’])
– \config-templatebuilder
– – \avia-shortcodes
– – – productslider.php (with the square changed to catalog)So this is the same file and directory structure as in the Enfold theme but it doesn’t seem to be picking up my changes at all.
- This reply was modified 9 years, 9 months ago by DigitalEssence.
February 17, 2015 at 8:09 pm #397752Hi!
WooCommerce has options for this in Dashboard > WooCommerce > Settings > Products > Display. You can change the image sizes for your catalogs there and decide if you want them cropped or not.
Cheers!
ElliottFebruary 17, 2015 at 8:46 pm #397775Hi Elliot,
Thanks for your reply. I’d already played with these but the markup still had the 180×180 image displaying despite what I changed the WooCommerce Catalog settings to and produced:
<img width=”180″ height=”180″ src=”full-path-to-image-180×180.jpg”
So no matter what I did in WC, Enfold still produced a square image.
Further to this, can you advise how I make a copy and place productslider.php into my child skin as I need to make a load more changes and don’t want it overwritten on the next update.
Thanks.
February 18, 2015 at 9:46 am #397989Hi!
1.) You can follow the solution provided here: https://kriesi.at/support/topic/best-way-to-add-image-sizes/#post-351286
2.) Add this to the child theme’s functions.php:
add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1); function avia_include_shortcode_template($paths) { $template_url = get_stylesheet_directory(); array_unshift($paths, $template_url.'/shortcodes/'); return $paths; }
Create a folder called shortcodes. Place the modified shortcode file inside.
Best regards,
IsmaelFebruary 18, 2015 at 12:26 pm #398042Ismael,
thank you.
That is sooo going in my bolierplate child theme functions.php
Please consider this issue well and truly closed.
-
AuthorPosts
- The topic ‘Is it possible to change the WooCommerce image pulled by Product List?’ is closed to new replies.