Support » Theme: Neve » Images not properly sized (I can’t find solution in past topics)

  • Resolved outsider98

    (@outsider98)


    Hi,

    I followed your recommended guide on how to change images size in Neve

    However, even after I installed your code as a Mu-plugin and Regenerated my thumbnails using the recommended plugin, I still had the following problems:

    1. The improperly sized images issue still showed up on page insights (Here’s the page insight result)

    2. The featured images of all my posts were all reduced to thumbnails (Here’s an example)

    I have read through past topics on the forum, but I can’t seem to find a solution.

    Please, I would appreciate any help you could give me on this issue. And if you need additional information, I would be happy to provide it.

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • newwithtags

    (@newwithtags)

    You can try to add_theme_support:

    add_action( 'after_setup_theme', 'my_child_theme_image_size', 11 );
    function my_child_theme_image_size() {
            add_theme_support( 'neve-blog' );
    	remove_image_size( 'neve-blog' ); 
    	add_image_size( 'neve-blog', 1060, 530, true );
    }

    Obviously, you will need to change the 1060, 530 to your required size. The “true” after the size means the images will be cropped. If you want the images scaled, not cropped, simply remove the “, true” bit.

    I had trouble getting it to work following the Theme Isle tutorial as well, until I came across this topic: https://wordpress.org/support/topic/featured-image-is-being-cropped/

    Thread Starter outsider98

    (@outsider98)

    @newwithtags

    I tried out your suggestion, but I’m still facing the same problems I stated in my first post.

    Here’s the code I used:

    add_action( 'after_setup_theme', 'my_child_theme_image_size', 11 );
    function my_child_theme_image_size() {
            add_theme_support( 'neve-blog' );
    	remove_image_size( 'neve-blog' ); 
    	add_image_size( 'neve-blog', 338, 225,);
    }

    Is there something else I should do after pasting the code in my child theme?

    Please, I would appreciate it if you could break down the process step by step.

    Thanks

    • This reply was modified 1 month ago by outsider98.
    • This reply was modified 1 month ago by outsider98.
    newwithtags

    (@newwithtags)

    There is an extra comma in your code. Try this:

    add_action( 'after_setup_theme', 'my_child_theme_image_size', 11 );
    function my_child_theme_image_size() {
            add_theme_support( 'neve-blog' );
    	remove_image_size( 'neve-blog' ); 
    	add_image_size( 'neve-blog', 338, 225 );
    }

    step 1- place the code in your child theme’s functions.php
    step 2 – clear your cache
    step 3 – regenerate thumbnails.
    If your changes are not visible right away, try visiting your site in a private window.

    Just to be clear, this will change the size of the featured image inside the post. Your featured images have a 338 px width now when viewing the post page, so the above code would generate the same results.

    The code above will not change the image thumbnail sizes which are called on the front page, so it will not help to improve your pagespeed score.
    To serve scaled images on the frontpage and other pages, you can:
    – go to regenerate thumbnails plugin settings and add a new image size with the dimensions you require (the size needed on the homepage) and a relevant name; (I think this is also possible with smush)
    – regenerate thumbnails for the newly created image size; (I think this is also possible with smush)
    – edit your homepage / other pages, select the blocks you use to show posts; in the block options panel, on the right, select featured image options and choose your newly created size.

    There might be an easier way, but not that I know of.

    Also, from what I can see, you (should) serve scaled and optimized images via smush cdn on your site so you might ask them for a solution to properly sizing your images.

    Thread Starter outsider98

    (@outsider98)

    @newwithtags Wow, thanks for clear things up. I honestly thought that this code was meant to help display scaled images on the front page.

    It turns out the main culprit behind my improper image issue is the plugin I use to display posts ( Siteorigin post loop). Apparently, the plugin has a fixed image dimension, and that’s what stopping Smush from scaling my images properly.

    Do you know of any other free plugin I can use to display posts on my homepage? One that also supports an alternating post layout similar to the Neve theme?

    • This reply was modified 1 month ago by outsider98.
Viewing 4 replies - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.