[wp-trac] [WordPress Trac] #21256: New theme feature - add_theme_support( 'content-width', $defaults )
WordPress Trac
wp-trac at lists.automattic.com
Sat Jul 14 10:52:50 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 | Resolution:
Keywords: dev-feedback 2nd-opinion |
--------------------------------------+------------------------------
Comment (by ramiy):
Replying to [comment:1 ocean90]:
You are right, Twenty Twelve has a very nice workaround for full-width
page-template:
{{{
if ( ! isset( $content_width ) )
$content_width = 625;
function twentytwelve_content_width() {
if ( is_page_template( 'full-width-page.php' ) || is_attachment()
) {
global $content_width;
$content_width = 960;
}
}
add_action( 'template_redirect', 'twentytwelve_content_width' );
}}}
I like this approach, but using conditionals to set different sizes for
different post-types requires many lines of code. with $defaults array
it's earier.
And remember that other themes do it in different ways. There is no
standard way to do this. If we will make it a core-theme-feature, all
themes will use it the same way.
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21256#comment:4>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list