Tagged: , ,

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #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, 2 months ago by WebbR.
    #1187769

    Hey WebbR,

    Could you please give us a link to your website, we need more context to be able to help you.

    Best regards,
    Victoria

    #1187779

    Hi 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!

    #1187869

    Hi 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,
    Victoria

    #1188030

    Hi 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!

    #1188206

    Hi WebbR,

    Then you will need to look into this file:
    /enfold/framework/php/class-framework-widgets.php

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #1188229

    Hi 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?

    #1188253

    Hi WebbR,

    Please try changing the settings here also:
    Image 2020-02-26 at 20.45.36.png

    Best regards,
    Victoria

    #1188314

    Hi 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!

    #1189020

    Hi 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!

    #1189038

    Hi,
    Sorry for the late reply, the reason your filter is not working is because avf_modify_widget_image_size is not a valid hook, you would need to use avf_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; 
    }

    2020-02-29-114019
    300px might be a little large for the widget area, but you can adjust to suit.

    Best regards,
    Mike

    #1189046

    Hey 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, 2 months ago by WebbR.
    #1189105

    Hi,
    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

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘Change widget image size’ is closed to new replies.