• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

How to Command a Theme to Always Display Images at a Certain Width?

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › Design Tips and Tricks › How to Command a Theme to Always Display Images at a Certain Width?

This topic is: not resolved
  • This topic has 7 replies, 2 voices, and was last updated 8 years, 10 months ago by Regev.
Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • March 4, 2017 at 7:08 am #202446
    Regev
    Participant

    I dislike it when images are constrained to the width of the content column, how do I enable them to display at a certain width (for example, 1280px) even if my content column is 717 (no sidebar theme)?

    Thanks!

    March 4, 2017 at 8:50 am #202454
    Victor Font
    Moderator

    See if this helps: http://www.modusagency.com/css-trick-expanding-a-div-beyond-a-parent-container/


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    March 4, 2017 at 2:20 pm #202467
    Regev
    Participant

    Hmmm isn't that a bit too complex? Somebody asked the same question on a non-Genesis theme's forum, somebody replied to him:

    The image isn’t wide enough to naturally fill the area you have positioned it within, but you can force the image to fill the space by making it 100% wide, like so:

    .post_content img { width: 100%; }

    Isn't there a similarly simple solution to simply force all content images in Genesis (specifically No Sidebar) to show at certain width?

    March 4, 2017 at 6:45 pm #202476
    Victor Font
    Moderator

    Here's another method that may be easier for you: https://wp-agency.co.uk/expanding-a-div-beyond-its-container-to-be-full-width-of-page/


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    March 5, 2017 at 3:06 am #202498
    Regev
    Participant

    Thanks Victor! I tried the code but it doesn't work - the image is enlarged, yes, but it isn't centered at all and messes some other elements.

    I did find a simpler solution, which is just changing the max-width value here to a higher number:

    embed,
    iframe,
    img,
    object,
    video,
    .wp-caption {
    	max-width: 100%;
    }

    To allow it to spread nicely and evenly, I then removed the 15% paddings from:

    .entry-content {	
    	padding-left: 15%;
    	padding-right: 15%;
    	clear: both;
    }

    But the problem is that the text now also extends to 1024 pixels (the 15% from each side brought it down to 717px). Any chance to apply the 15% paddings to the text only so that it gets narrower back to 717px? Even better, to simply remove the 15% paddings to everything media related (images, videos, etc)

    Any idea much appreciated.
    Thanks

    March 5, 2017 at 4:23 pm #202522
    Victor Font
    Moderator

    Try using negative margins for the image and leave the padding alone.


    Regards,

    Victor
    https://victorfont.com/
    Call us toll free: 844-VIC-FONT (842-3668)
    Have you requested your free website audit yet?

    March 5, 2017 at 5:27 pm #202524
    Regev
    Participant

    Ok, but what negative margins exactly would you use to keep the images (can be anything from 600px to 1024px wide, which is also the containing div's width) centered nicely?

    Thanks again, Victor.

    March 9, 2017 at 3:56 pm #202776
    Regev
    Participant

    Still can't align them properly. The problem is that I reached a number that works very beautifully for *most images*, but anything smaller (images that can't scale up to 1024) get pulled to the left too much. Isn't there some CSS trickery to solve this?

  • Author
    Posts
Viewing 8 posts - 1 through 8 (of 8 total)
  • The forum ‘Design Tips and Tricks’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2026 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble