Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Elise Alley

    (@ecalley)

    Hi vizou,

    To control the size of the image on the store page, you’ll go into your Exchange file and into /lib/templates/content-store/elements. There you’ll find and copy the featured-image.php file. In your copy of the file, on about line 20, you’ll find where the image size is set.

    <?php it_exchange( 'product', 'featured-image', array( 'size' => 'large' ) ); ?>

    Try changing ‘large’ to ‘thumbnail’ (it uses the default WordPress image sizes). In your WordPress dashboard, go to Settings > Media and set your Thumbnail size to whatever you’d like it to be. Then you’ll create a directory in your child theme: /wp-content/themes/YourTheme/exchange/content-store/elements/. There, you’ll upload your copy of the featured-image.php file. That should take care of your images all being the same size on your store page.

    If you changed your image sizes in Settings > Media, it won’t change the size of images already on your site. You might look into plugins like this to regenerate the older images on your site: https://www.ads-software.com/plugins/regenerate-thumbnails/

    Let us know if you have any additional questions.

    Thanks,

    Elise

    Thread Starter Vizou

    (@vizou)

    Thanks for the response!

    I totally get how it works with templates… but unfortunately your great explanation doesn’t answer my question about how to use a CUSTOM image size (one that is registered in theme functions.php or in a custom plugin in my case).

    I want to use my custom size “thirdcolumn” and Exchange doesn’t recognize this custom size which is registered by my theme. I don’t want to use the image sizes generated by the Media settings. Is this possible?

    I should further state that I am using a custom page template to display the store products (so I can break them into categories). In that template, I am using code from the Exchange templates (which I also have within my theme). My custom queries look something like this :

    <?php do_action( 'it_exchange_content_store_before_wrap' ); ?>
    <?php do_action( 'it_exchange_content_store_begin_wrap' ); ?>
    
    <?php $my_query = new WP_Query('post_type=it_exchange_prod&taxonomy=it_exchange_category&term=linda-digital&posts_per_page=-1&orderby=menu_order&order=asc'); ?>
    
    <ul class="products">
      <?php while ($my_query->have_posts()) : $my_query->the_post(); ?>
      <li>
        <?php it_exchange_set_product( $post->ID ); ?>
        <?php it_exchange( 'product', 'featured-image', array( 'size' => 'thirdcolumn' ) ); ?>
        <?php the_title(); ?>
      </li>
    <?php endwhile; ?>
    </ul>
    
    <?php do_action( 'it_exchange_content_store_after_wrap' ); ?>
    <?php do_action( 'it_exchange_content_store_after_wrap' ); ?>

    The template works fine except for the image size.

    Was there any answer on this?

    I am having the same issue – images are not displaying correctly in my theme.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom thumbnail sizes’ is closed to new replies.