• Hello, I have an issue with automatic thumbnail height and auto-crop setting.

    – In functions.php I have this code:

    add_theme_support('post-thumbnails');
    set_post_thumbnail_size('', 300, true);

    – In index.php I have this code:
    <?php $image_src = wp_get_attachment_image_src( get_post_thumbnail_id(),’thumbnail’ ); echo '<img width="100%" src="' . $image_src[0] . '" class="attachment-post-thumbnail wp-post-image">'; ?>

    – I have installed and run the “Regenerate Thumbnails” plugin.

    Nothing changes, the thumbnails stay the same… what did I forget?

    Thank you!
    NM

Viewing 2 replies - 1 through 2 (of 2 total)
  • Single quotes around the word thumbnail are wrong:

    get_post_thumbnail_id(),’thumbnail’ ); echo … etc

    Delete them and replace with new ones, it’s an error caused by copying and pasting from a web page.

    Thread Starter mad_griffith

    (@niccolomineo)

    thanks, it works.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Thumbnails automatic height and auto-crop’ is closed to new replies.