-
AuthorPosts
-
February 23, 2020 at 5:14 pm #1187118
Hi there, I’m setting up a woocommerce with Enfold and would like to change the size of the images used in the footer widgets products list.
At the moment: widget: 36×36 Pixel
Is it possible to change this via the functions.php?
THX & have a nice day everybody :)- This topic was modified 4 years, 8 months ago by WebbR.
February 25, 2020 at 5:01 pm #1187769Hey WebbR,
Could you please give us a link to your website, we need more context to be able to help you.
Best regards,
VictoriaFebruary 25, 2020 at 5:26 pm #1187779Hi and THX for the Reply – The page is in maintenance-mode. Link is https://nasenbluten.info/ . Credentials in private section.
The widget is in the left footer widger-ares.THX for taking care!
February 25, 2020 at 10:28 pm #1187869Hi WebbR,
Here is the code you can put in Enfold > General Styling > Quick Css, if it does not work, put into themes/enfold/css/custom.css
div ul.product_list_widget li img { width: 80px; }
If you need further assistance please let us know.
Best regards,
VictoriaFebruary 26, 2020 at 12:24 pm #1188030Hi Victoria, yes I know but this just changes the displayed size, if you use a bigger number like maybe 300px it will be blured.
So it is not a good solution :(
I need to change the HTML output size of the imagetype “widget”.
Thank you & best regards!February 26, 2020 at 7:42 pm #1188206Hi WebbR,
Then you will need to look into this file:
/enfold/framework/php/class-framework-widgets.phpIf you need further assistance please let us know.
Best regards,
VictoriaFebruary 26, 2020 at 8:09 pm #1188229Hi Victoria! Thx for the hint!
I checked the file but there isn’t any setting.
But the size is read from $avia_config
$image_size = isset($avia_config['widget_image_size']) ? $avia_config['widget_image_size'] : 'widget';
So I tryed to change the setting with a filter in functions.php of the child theme.add_filter( 'avf_modify_widget_image_size', 'enfold_customization_modify_widget_size', 10, 1 ); function enfold_customization_modify_widget_size( $size ) { $size['widget'] = array('width'=>300, 'height'=>300); return $size; }
Unforunatly no success – still when I check the sizes via regenerate thumbnails it is still 35×35 pixels.
Anything wrong with the filter?February 26, 2020 at 8:45 pm #1188253February 27, 2020 at 1:51 am #1188314Hi Victoria, maybe I don’tunderstand your intention, but there is no such option to change widget_image_size values.there.
Those are the WP-Standard image sizes. Nothing else…
But please tell me: is there anything wrong with the filter?
If yes – what?
Thx a lot!February 29, 2020 at 2:33 pm #1189020Hi again! Support ended here or is there anybody who can tell me why this filter is not working?
add_filter( 'avf_modify_widget_image_size', 'enfold_customization_modify_widget_size', 10, 1 ); function enfold_customization_modify_widget_size( $size ) { $size['widget'] = array('width'=>300, 'height'=>300); return $size; }
Would be great to have an answer :) THX & a nice weekend to everybody!
February 29, 2020 at 6:43 pm #1189038Hi,
Sorry for the late reply, the reason your filter is not working is becauseavf_modify_widget_image_size
is not a valid hook, you would need to useavf_modify_thumb_size
like this:add_filter( 'avf_modify_thumb_size', 'enfold_customization_modify_widget_size', 10, 1 ); function enfold_customization_modify_widget_size( $size ) { $size['widget'] = array('width'=>300, 'height'=>300); return $size; }
then after adding you need to regenerate the widget image sizes, I used Simple Image Sizes to do this, but you can also use this plugin to change the size instead of the filter if you wish.
Then you also need to change the css so the image will show larger than the 36px by 36px size:div ul.product_list_widget li img { width: 300px !important; }
300px might be a little large for the widget area, but you can adjust to suit.Best regards,
MikeFebruary 29, 2020 at 7:39 pm #1189046Hey Mike! Thank you! The avf_modify_thumb_size did the trick! Everything is working fine now!
And for the image size – 300px fits my plans ;)
Perfect & again – Thank you!- This reply was modified 4 years, 8 months ago by WebbR.
February 29, 2020 at 10:13 pm #1189105Hi,
Glad we were able to help, we will close this now. Thank you for using Enfold.For your information, you can take a look at Enfold documentation here
For any other questions or issues, feel free to start new threads in the Enfold forum and we will gladly try to help you :)Best regards,
Mike -
AuthorPosts
- The topic ‘Change widget image size’ is closed to new replies.