Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other $content_width and RWD

  • This topic is empty.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #41432
    lenzjo
    Participant

    I’m designing a responsive theme for WordPress and I don’t know what to do about the $content_width variable. as the width would depend on the viewport. Does anybody know what I should do?

    #117998
    Andy Howells
    Participant

    I believe, and I may be wrong, $content_width in WordPress is a way to set the max width of images.

    If you’re using responsive design techniques, what you could do is simply override the standard image width/height markup using CSS.

    For example, setting a max-width of a particular amount, or indeed 100% – with height set to auto, that way you know that the images will never expand beyond their container, so when downsizing they will adjust to fit automagically.

    #118057
    lenzjo
    Participant

    Yes Andy, that’s exactly what I do with images. I too have read “rumours” of it being used to stop images overflowing, but it is so poorly documented. I thought I could just leave it out so I ran the theme-tester plugin after removing the:

    if ( !isset( $content_width ) ) $content_width = 610;

    and it threw up an error stating that the line was required so I don’t know what to do now.

    #118161
    lenzjo
    Participant

    Thx ChrisP, but I’m already doing that. It’s the $content_width variable and setting (or not) it’s value.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘Other’ is closed to new topics and replies.