Support » Theme: Twenty Fifteen » Image rules similar to featured images

  • Rebecka


    I like how featured images work in the theme. No matter what format (horizontally or vertically) the images stay within certain dimensions.

    Now I wonder how I enforce the same rules for images inside posts and pages? There already seems to be a maximum width since uploaded images never exceed the text width. However, there is no maximum height and that is what I want to achieve. I also want vertical images just like featured images to be centered by default.

    Right now, vertical images can be so large that you need to scroll and not be able to see the entire image in the window. Of course, I can minimize each time I upload vertical images (or upload the correct size), but I’d rather see a maximum height so people can enlarge full-screen images if they want (and I don’t have to minimize each time).

    Here is a preview image to demonstrate how it looks now (default):

    I had to zoom out in the browser to be able to display as in the preview image. If it is not clear, the top image is the featured image and the bottom image is the same image but inside the post.

    Thanks in advance!

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

Viewing 2 replies - 1 through 2 (of 2 total)
  • Jarret


    The featured images section doesn’t know if the image is a vertical/horizontal/square image. All it does is use CSS to center align the image, apply a max-width and then the height set based upon the ratio of the image to keep it from being distorted.

    From what I understand what you’re wanting to do, you’d need to have some type of functionality (plugin) active on the site to find the dimensions of an inserted image, apply a specific CSS class if it is determined to be vertical and then apply custom CSS to handle that within the post content.



    Thanks for the reply @jarretc

    A plugin sounds good, then I can control image sizes no matter what theme I use. Suggestions for such a plugin?

    I also remembered that I can adjust the image size after uploading. During editing under Settings > Block > Image Size. I can choose miniature, medium, large, full size and percentages like 25%, 50%, 75% and 100%, as well as my own values. However, I noticed that it does not help me to reduce the image. If I choose a height, the width is not automatically adjusted, but I have to set this myself?

    The important thing for me is to be able to enlarge the image in full screen mode (lightbox). So I don’t want to upload smaller pictures even though I want smaller pictures in posts.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.