• Resolved jabrenna

    (@jabrenna)


    My question is about the ‘featured image’ in a post of the format ‘image’ using the Hueman theme.
    For my post pages, I have turned off the secondary sidebar and have calculated that the optimal size for my featured image is a width of 980px.
    I resize my image before uploading to WordPress and set it as the featured image.
    However, on the published post the image looks blurred. A quick check of the source code using Firebug shows that somewhere the image is being downsized to a max-width of 720px and then shown at 100%, so in effect degrading the image, i.e. making it smaller then stretching it.
    This code snippet which shows in the HTML seems to be the culprit, but I can’t tell where it’s coming from:
    sizes="(max-width: 720px) 100vw, 720px"
    I have tried adding various things to the theme’s editor:
    e.g.
    img { max-width: 980px; }
    I have also edited the following text in functions.php:
    add_image_size( 'thumb-large', 980, 463, true );
    but nothing works.
    Could anyone help me out here?
    Thanks and much appreciate any suggestions,
    A~

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi jabrenna. Welcome to the Hueman forum. The theme defines the “thumb-large” size of 720×340 in function hu_setup(). Single.php then calls post-format.php which uses “thumb-large” to display the featured image. The theme css sets the image width to 100% of the content area. The content width when using two sidebars is 720px which matches “thumb-large”. Since you’re only using one sidebar the image is “stretched” to the 980px content area width and the height is adjusted proportionately.

    I haven’t tested this but you could try overriding the theme image size declaration by using this in your child theme functions.php file:

    add_action( 'after_setup_theme', 'jabrenna_image_size', 11 );
    function jabrenna_image_size() {
        add_image_size( 'thumb-large', 980, 463, true );
    }

    Here’s a refernce: https://wordpress.stackexchange.com/questions/74934/remove-or-update-add-image-size

    The above will apply to all images uploaded after you create the function. To update your existing images use the Regenerate Thumbnails plugin:
    https://www.ads-software.com/plugins/regenerate-thumbnails/

    Thread Starter jabrenna

    (@jabrenna)

    Thanks a million bdbrown – I don’t know if it was the Regenerate Thumbanils plugin (which was installed, although I didn’t know I had it or that you had to ‘run’ it) or your code snippet, but everything is looking lovely now with images displaying at the intended width.
    I really appreciate it, thanks,
    J

    You’re welcome; glad it’s working.

    In addition to the above, which worked great for me, can you also provide the code/function for the “thumb-medium”?

    On the main blog page, the latest post displays the featured image as “thumb-large”, but all other posts below it appear to be using “thumb-medium”.

    TIA,
    Geary.

    Hueman Thumbnail sizes
    ‘thumb-small’ 160×160
    ‘thumb-standard’ 320×320
    ‘thumb-medium’ 520×245
    ‘thumb-large’ 720×340

    @moonspellsquinte – this topic is marked Resolved. If you have additional questions please start a new topic. Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Stop resizing of featured image in an image post format’ is closed to new replies.