Support » Fixing WordPress » How can I fit image size to the width of a post?

  • Dear all,

    I would like to define the size of an image so that it matches the width of a post.

    How can I do that?

    Thankfully,

    -Robert

    Size of image setting

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Forum Moderator & Support Team Volunteer

    1) upload the image in the right size to begin with

    2) add a new image size via add_image_size to match your desired width https://codex.wordpress.org/User:Esmi/add_image_size()

    You can use the full size image as it will be shown at the post width, but 2560 wide seems a little excessive.

    You could also use a bit of css to fix this. Target the img itself

    .img { width: 100%; height: auto }

    Thank you!

    From the provided options, simply using the full size seems the most user-friendly and most intuitive.

    Yet I would like to suggest a new default entry as follows:

    Where is the best place to suggest this feature to the developers?

    Warmly,

    -Robert

    Mockup

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How can I fit image size to the width of a post?’ is closed to new replies.