[wp-trac] [WordPress Trac] #21256: New theme feature - add_theme_support( 'content-width', $defaults )

WordPress Trac wp-trac at lists.automattic.com
Fri Jul 13 10:08:35 UTC 2012


#21256: New theme feature - add_theme_support( 'content-width', $defaults )
-----------------------------+--------------------------------------
 Reporter:  ramiy            |      Owner:
     Type:  feature request  |     Status:  new
 Priority:  normal           |  Milestone:  Awaiting Review
Component:  Themes           |    Version:  3.4.1
 Severity:  normal           |   Keywords:  dev-feedback 2nd-opinion
-----------------------------+--------------------------------------
 Themes use '''$content_width''' variable to set the content area width,
 they use:

 {{{
 if ( ! isset( $content_width ) )
         $content_width = 500;
 }}}

 This method has two flaws, it's not flexible and it does not support
 different sizes for different post-types.

 WordPress has to make the content-width to be a builtin theme feature
 using '''add_theme_support()''', and make it more flexible and easy to
 update. I want to update this value using the Theme Customizer rather
 editing the function.php file.

 The code needs to be easy to set and to support CPT, some thing like this:

 {{{
 $defaults = array(
         'post'       => '500',
         'page'       => '500',
         'attachment' => '650',
         'artist'     => '300',
         'movie'      => '400'
 );
 add_theme_support( 'content-width', $defaults );
 }}}

 Just an idea for 3.5.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/21256>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list