Skip to content

Commit

Permalink
Move to new best practice of defining $content_width
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottSmith95 committed May 13, 2015
1 parent ee3c7f6 commit aaba93b
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,6 @@
* @package Decode
*/

/*
* Set the content width based on the theme's design and stylesheet.
*/
if ( ! isset( $content_width ) ) {
$content_width = 640; /* pixels */
}

if ( ! function_exists( 'decode_setup' ) ) :
/*
* Sets up theme defaults and registers support for various WordPress features.
Expand Down Expand Up @@ -122,6 +115,18 @@ function decode_setup() {
endif; // decode_setup
add_action( 'after_setup_theme', 'decode_setup' );

/**
* Set the content width in pixels, based on the theme's design and stylesheet.
*
* Priority 0 to make it available to lower priority callbacks.
*
* @global int $content_width
*/
function decode_content_width() {
$GLOBALS['content_width'] = apply_filters( 'decode_content_width', 640 );
}
add_action( 'after_setup_theme', 'decode_content_width', 0 );

/*
* Register styles and scripts.
*/
Expand Down

0 comments on commit aaba93b

Please sign in to comment.