Title: $content_width in a responsive theme
Last modified: August 20, 2016

---

# $content_width in a responsive theme

 *  [lenzjo6754](https://wordpress.org/support/users/lenzjo6754/)
 * (@lenzjo6754)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/content_width-in-a-responsive-theme/)
 * What should I do about:
 * code ‘if ( !isset( $content_width ) ) $content_width = 610;’
 * when creating a responsive theme? Because there is no knowing what the width 
   of the page will be.

Viewing 8 replies - 1 through 8 (of 8 total)

 *  [Yakir Gottesman](https://wordpress.org/support/users/yakirgot/)
 * (@yakirgot)
 * [13 years, 5 months ago](https://wordpress.org/support/topic/content_width-in-a-responsive-theme/#post-3288975)
 * Same question.
 *  [piggy017](https://wordpress.org/support/users/piggy017/)
 * (@piggy017)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/content_width-in-a-responsive-theme/#post-3289011)
 * anyone find out the solutions yet?
    having the same prob here 🙁
 *  [paulwpxp](https://wordpress.org/support/users/paulwp/)
 * (@paulwp)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/content_width-in-a-responsive-theme/#post-3289012)
 * `$content_width` only used in oEmbed. It determines the size of embed content
   like youtube.
    [http://codex.wordpress.org/Embeds](http://codex.wordpress.org/Embeds)
 * See `functions.php` of Twentytwelve on how to change `$content_width` based on
   theme layout.
 *  [Yakir Gottesman](https://wordpress.org/support/users/yakirgot/)
 * (@yakirgot)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/content_width-in-a-responsive-theme/#post-3289013)
 * Yes, but what about responsive themes?
 *  [paulwpxp](https://wordpress.org/support/users/paulwp/)
 * (@paulwp)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/content_width-in-a-responsive-theme/#post-3289014)
 * I use this plugin with great result.
 * **Responsive Video Embeds**
    [http://wordpress.org/plugins/responsive-video-embeds/](http://wordpress.org/plugins/responsive-video-embeds/)
 * There is also JS solution `fitvids.js`, but I prefer non JS
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [12 years, 10 months ago](https://wordpress.org/support/topic/content_width-in-a-responsive-theme/#post-3289015)
 * responsive themes usually have a max width – adjust the `$content_width` to fit
   that max width; smaller screen sizes should then adjust automatically.
 *  [Tevya](https://wordpress.org/support/users/thefiddler/)
 * (@thefiddler)
 * [12 years, 9 months ago](https://wordpress.org/support/topic/content_width-in-a-responsive-theme/#post-3289016)
 * I’m not sure I’m following you [@alchymyth](https://wordpress.org/support/users/alchymyth/).
   Could you explain in more detail?
 * It seems like there should be a way to set $content_width to a max pixel width,
   but still have it responsive to the available space. However, I haven’t been 
   able to find anything that explains how you’d go about doing this.
 * EDIT: found some agrement that this sucks: [http://wycks.wordpress.com/2013/02/14/why-the-content_width-wordpress-global-kinda-sucks/](http://wycks.wordpress.com/2013/02/14/why-the-content_width-wordpress-global-kinda-sucks/)
 * I also found out the 2012 theme makes the new WP 3.6 player very responsive. 
   It’s not a problem there. But I can’t find anything about how they did it. And
   the YouTube player is not very responsive, the width of the video player changes,
   and the video itself resizes nicely, but the height of the player doesn’t change(
   at least when dragging the browser size).
 *  [xlp](https://wordpress.org/support/users/xlp/)
 * (@xlp)
 * [12 years, 8 months ago](https://wordpress.org/support/topic/content_width-in-a-responsive-theme/#post-3289017)
 * I have the same question. And I found one more anoying thing, I set in media 
   preferences 2 sizes for the images (Medium and Large), but as i have a responsive
   theme and want to supply 2x images for retina displays my images are double in
   size, so my Large image size is 1600px and then with css is set to 50% of this
   size to look as 800px. I found that if I have a $content_width= 900 the size 
   Large is no longer 1600px, is automatically set to 900, the medium size is not
   modified and is 1200px (bigger than the content–width). So i removed the $content_width
   function…

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘$content_width in a responsive theme’ is closed to new replies.

## Tags

 * [rwd](https://wordpress.org/support/topic-tag/rwd/)

 * 8 replies
 * 7 participants
 * Last reply from: [xlp](https://wordpress.org/support/users/xlp/)
 * Last activity: [12 years, 8 months ago](https://wordpress.org/support/topic/content_width-in-a-responsive-theme/#post-3289017)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
