Use image thumbnails in home page

Hi,

I need to reduce my homepage (and archive pages) size, so I want to load the thumbnail (the medium one) instead of the original image.

I am using X with Ethos stack here: https://www.mondo3.com/

I cannot find what to modify in order to achieve that result, can you please help me?

Thank you

Hey @faquick,

You will need to copy the x_featured_image function in the featured.php file located in \themes\x\framework\functions\global to your child theme’s functions.php. Change the thumbnail sizes like entry-cropped-fullwidth to your desired image size. Here’s the default WordPress image sizes.

Hope that helps.

Hi,

I tried that but without success.

I digged up a little more and I found - inside framework/functions/ethos.php - function called x_ethos_entry_cover_background_image_style

I put that one on my functions.php and edited by putting “medium” and it looks like it is working now. Any possible problems I could run into by using this function?

  function x_ethos_entry_cover_background_image_style() {

    $featured_image   = x_make_protocol_relative( x_get_featured_image_url('medium') );
    $background_image = ( $featured_image != '' ) ? 'background-image: url(' . $featured_image . ');' : 'background-image: none;';

    return $background_image;

  }

Hi There,

It should be fine :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.