• Resolved nicoter

    (@nicoter)


    Hi,

    I found this filter which gets applied in the function astra_get_post_thumbnail() in inc/extras.php:

    apply_filters( 'astra_post_thumbnail_default_size', 'large' )

    With the Simple Image Sizes plugin I created a custom image size named ‘large_custom’.

    How can I override the filter and make the theme use this custom size?

    Thanks

Viewing 6 replies - 1 through 6 (of 6 total)
  • Thread Starter nicoter

    (@nicoter)

    add_filter('astra_post_thumbnail_default_size', 'custom_featured_image_size');
    
    function custom_featured_image_size($size){
    	$size = 'large_custom';
    	return $size;
    }

    Is there a way to achieve this without coding?

    I’ve set my container width to 1200px. Somehow the width of my featured images seem to stick at 1024px (even the larger images, for example the ones that are 1920px wide).

    Thread Starter nicoter

    (@nicoter)

    Did you regenerate the thumbnails already? Use this: https://www.ads-software.com/plugins/regenerate-thumbnails/

    No…

    Do you mean, after setting container width to 1200px, I can regenerate thumbnails and then they will be 1200px wide as well?

    Or do I need to add your code as well?

    In the best situation I’d like to use a full width original image (so not a generated thumbnail), that is 2400px wide (for retina), stretched full width at 100% in the 1200px wide container.

    Thread Starter nicoter

    (@nicoter)

    Yes, if the images were uploaded while different thumbnails sizes were defined. This can be the case when a different theme or maybe even different container width was active. Worth a try.

    To use 2400px images you need to change the default size of the featured image like I described in my first two posts:

    1. Created a custom image size with with the plugin linked in the first post.
    2. Run the custom code which can easily be done with https://www.ads-software.com/plugins/code-snippets/

    Ok, thnx.

    Just trying to switch from OceanWP to Astra, but so far it seems OceanWP does have some easier to understand UX settings… Some more UX settings as well.

    However, I’ve heard Astra does a good job with WooCommerce, especially with Cartflows. Otherwise I guess I would have stuck with OceanWP…

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