CYBER MONDAY SALE! 30% DISCOUNT!! Coupon code:cm30 Enjoy!!!

Theme thumbnail sizes?

Home Forums Spacious Free Theme thumbnail sizes?

This topic contains 25 replies, has 4 voices, and was last updated by  Bishal Napit 1 month, 3 weeks ago.

Viewing 15 posts - 1 through 15 (of 26 total)
  • Author
    Posts
  • #1376151

    cagross
    Participant

    Hello. Whenever I upload an image to the WordPress back-end, the theme creates several thumbnails of different size. For the past few years, I believe one of these sizes has been 750 x 500 px–can you conform that? I ask because today I uploaded an image, and a thumbnail of this size was not created. Is that because of a change you’ve made to the theme?

    Thanks in advance.

    #1376218

    Rajesh
    Moderator

    Hi @cagross,

    Can you clarify as to in which size image upload, the image of 750*500 size was generated? Also, whenever you upload an image, if it is greater than the recommended size, then the image is cropped as recommended. You can take the reference for recommended image size for our theme from the link below under section 14:

    Spacious

    Thanks.

    #1376317

    cagross
    Participant

    >> Can you clarify as to in which size image upload, the image of 750*500 size was generated?

    Sorry I don’t understand what you are trying to ask here. Can you clarify your question?

    >> Also, whenever you upload an image, if it is greater than the recommended size, then the image is cropped as recommended

    I realize that.

    >> You can take the reference for recommended image size for our theme from the link below under section 14:

    You posted a link to the Spacious documentation https://docs.themegrill.com/spacious/ But you can be more specific as to where in the documentation I can read about image sizes?

    Also, to be clear, here is what I would like to know. When I upload an image, the theme ensures that thumbnails of different sizes are automatically created–is that correct? If so, what are the names and sizes of each thumbnail?

    Thanks.

    #1376443

    Ashish
    Moderator

    Hi @cagross
    You can get recommended images from here under Recommended Image Size section of the documentation.
    https://docs.themegrill.com/spacious/#section-14

    So, if you upload recommended images size ( or greater ) for respective options, you’ll get the mentioned images for the same option.

    Can you provide a link of the page where you’re having trouble with image size?

    Regards,
    ThemeGrill Support Team.

    #1376573

    cagross
    Participant

    OK thanks for your help so far.

    First of all, before we continue, I should alert you to a small technical issue with the links you are sending me. When you posted your reply, I received an email notification as expected. In that email I can see that you are trying to link me to a URL with “#section-14” appended to it:
    “https://docs.themegrill.com/spacious/#section-14” (screenshot). But when I open the ticket in your your support forum, the page has automatically stripped off the #section-14 portion of the URL (screenshot). So that is part of our confusion so far. Hopefully you can pass that up to the relevant department to address.

    OK, back to the issue at-hand. I have read the documentation page and see that the recommended size for Featured Blog Post (large) is 750 x 350 px. For the past two years my child theme has possessed custom PHP code that changes the size of Featured Blog Post (large) on my blog page from 750 x 350 to 750 x 500. That code is:

    add_action('wp_enqueue_scripts', 'remove_then_add_image_sizes');
    function remove_then_add_image_sizes() {
    	if( is_home() ) {
    		remove_image_size('featured-blog-large');
    		add_image_size('featured-blog-large', 750, 500, true);
    	}
    }

    Up until recently, this has worked as expected–as you can see on the page, all featured images are 750 x 500, except the most recent, which is back to 750 x 350. Do you have any idea why this has stopped working as expected? The native size of every featured image before uploading to WordPress is 750 x 500–that is something I ensure.

    There are no PHP errors in debug.log.

    Thanks.

    #1376652

    Ashish
    Moderator

    @cagross
    I was aware of that thing you mentioned. But I forgot to add the link in a proper way, now you might get right link.

    Also, I think there’s an issue with your code above. You do not need the is_home condition there. So, fixing the hook, the final code should be like this:

    function remove_then_add_image_sizes() {
    	remove_image_size('featured-blog-large');
    	add_image_size('featured-blog-large', 750, 500, true);
    	
    }
    add_action('after_setup_theme', 'remove_then_add_image_sizes');

    Now, it should load that image size if you set to load the large image in a blog post from customizer. Note that, you may need to regenerate thumbnail using plugin to recreate image for new size.

    I hope this works for you. If not, let us know. Thanks.

    #1387305

    cagross
    Participant

    Hello. I’m very sorry for the delay–some things came up. I am ready to revisit this issue. To remind you, my blog page displays the featured image for each post, and it displays them at a size of 750 x 350 px. Is there a way in theme options to instruct the blog page to display these images at full size, rather than 750 x 350? I think that would best resolve my issue. That way, before I upload the featured image to WordPress, I can ensure the image is my desired size (750 x 500).

    If I cannot do something like that in theme options, how might I approach doing so via custom code in my child theme’s functions.php? To be clear, I would like to display the featured images at 750 x 500, but I don’t think I need to register a new thumbnail size of 750 x 500. I will ensure the native size for all featured images is 750 x 500. If I do that, it may be easier to simply instruct WordPress to display the blog page featured images at full size.

    Thanks.

    #1387805

    Bishal Napit
    Moderator

    @cagross

    If you can code that on your own then, you can achieve the same via child theme modifying the featured-blog-large image size. The solution is also mentioned previously by us for same. So, can you once check for same and confirm? Thanks.

    #1387938

    cagross
    Participant

    Thanks for the reply. I have added the code you suggested earlier. But the size of ‘featured blog large’ still appears to be 750 x 350 (screenshot). Furthermore, after I regenerate thumbnails, there is no thumbnail created at the expected size (i.e. 750 x 500). There are no entries in the PHP error log. Thoughts on that?

    #1388094

    Rajesh
    Moderator

    Hi @cagross,

    Can you add the code mentioned below in the child theme?

    function remove_then_add_image_sizes() {
    
    	add_image_size('featured-blog-large', 750, 500, true);
    	
    }
    add_action('after_setup_theme', 'remove_then_add_image_sizes', 11);

    After using the above code in the child theme, can you regenerate the thumbnails and check?

    Thanks.

    #1388469

    cagross
    Participant

    I have added that exact code to my child theme’s functions.php (screenshot). After, the regenerate thumbnails plugin seemed to recognize that the size of featured-blog-large is 750 x 500, as expected (screenshot). But when I regenerated thumbnails and reloaded the page, the page still displays the 750 x 350 thumbnail (screenshot). Why is this occurring, and how should I proceed?

    I have made sure to clear all caches when refreshing the page.

    #1388544

    Bishal Napit
    Moderator

    @cagross

    First of all, you need to deregister that, ie, unrequired image size for your site, and then only register new image size. As we see from the code, you are only registering new size, not unregistering old image size. Hope now you can achieve the same with ease. Thanks.

    #1388569

    cagross
    Participant

    Bishal,

    Thank you for your help so far. Here are my follow-ups:

    >> As we see from the code, you are only registering new size, not unregistering old image size. Hope now you can achieve the same with ease. Thanks.

    I have added exactly the code your support agents have instructed me to add. Now it sounds like you are saying they told me to add incorrect code–is that accurate? If so, can you please tell me exactly what code to add, and I will add it. Is this the code you would like me to add:

    function remove_then_add_image_sizes() {
    remove_image_size(‘featured-blog-large’);
    add_image_size(‘featured-blog-large’, 750, 500, true);

    }
    add_action(‘after_setup_theme’, ‘remove_then_add_image_sizes’);

    #1388656

    Bishal Napit
    Moderator

    @cagross

    After amending the code, did you also regenerate the images via the ‘Regenerate Thumbnails’ plugin available via the WordPress plugin directory? If not then, can you once check for same and confirm? And again if that does not work then, can you try the below PHP code instead and regenerate images and check once:-

    function remove_then_add_image_sizes() {
    	remove_image_size( 'featured-blog-large' );
    	add_image_size( 'featured-blog-large', 750, 500, true );
    }
    
    add_action( 'init', 'remove_then_add_image_sizes', 12 );

    Thanks.

    #1388746

    cagross
    Participant

    >> After amending the code, did you also regenerate the images via the ‘Regenerate Thumbnails’ plugin available via the WordPress plugin directory?

    Yes, as I mentioned, I have already executed ‘Regenerate Thumbnails.’ The plugin recognizes that ‘featured-blog-large’ should be 750 x 500 in size. But after the plugin finishes regenerating all thumbnails, I do not see a thumbnail of size 750 x 500 for the image in-question. To be clear, the name of my image is http://kabultec.org/dev/wp-content/uploads/2018/06/holding-hands-750x500.jpg After regenerating thumbnails, am I correct that there should be an image of size 750 x 500 at the URL http://kabultec.org/dev/wp-content/uploads/2018/06/holding-hands-750×500-750×500.jpg? That URL returns a 404 error. Furthermore, my blog page still displays the featured image at 750 x 350, rather than 750 x 500.n

    >> If not then, can you once check for same and confirm?

    I have just run ‘Regenerate Thumbnails’ once again, and I am experiencing the same results.

    >> And again if that does not work then, can you try the below PHP code instead and regenerate images and check once:-

    OK I have just added the new code and re-tested, and am experiencing the same results. How should I proceed? Can I give my login details for you to test?

Viewing 15 posts - 1 through 15 (of 26 total)

You must be logged in to reply to this topic.