Knowledgebase

How to change the image height in the Content Widget

Intro

Either install the Solid Code Theme Editor plugin and access it from Appearance > SC Theme Editor, or create a copy of the widget as specified in the above “Child Theme” article. Line numbers may vary slightly depending on your theme. Please note the themes this article is intended for under the title above! Lines […]

Solution

Either install the Solid Code Theme Editor plugin and access it from Appearance > SC Theme Editor, or create a copy of the widget as specified in the above “Child Theme” article.

Line numbers may vary slightly depending on your theme. Please note the themes this article is intended for under the title above!

Lines 91-95 define the image:

$width = 490;
$height = 368;
$resizer = '4-3-medium';

If you have products that require taller portrait images such as posters or shirts, add another condition on the line following the “resizer” line, as shown in red below:

elseif($layout_columns !="1"): 
 $width = 490;
 $height = 368;
 $resizer = '4-3-medium';
elseif($posttype == 'product') :
 $width = 660;
 $height = 660;
 $resizer = '660auto';

If you are using a 2 column layout and need the height to be taller than a maximum of 660 pixels, change the height value.

If edited locally, upload via FTP to wp-content/themes/yourtheme/ocmx/widgets/

 

Get 15% off!

Signup and get 15% off any of our Ghost or Framer themes immediately