[theme-reviewers] $content_width

Chip Bennett chip at chipbennett.net
Mon Apr 28 12:52:07 UTC 2014


Yes, inside of a callback, $content_width must be declared as a global
before use.


On Mon, Apr 28, 2014 at 8:46 AM, Srikanth Koneru <tskk79 at gmail.com> wrote:

> Since we are required to put $content_width in setup function, should it
> be declared as global or is it not necessary?
>
> function themename_setup() {
> global $content_width;
> if ( ! isset( $content_width ) ){
>       $content_width = 640;
> }
> }
> add_action( 'after_setup_theme', 'themename_setup' );
>
> _______________________________________________
> theme-reviewers mailing list
> theme-reviewers at lists.wordpress.org
> http://lists.wordpress.org/mailman/listinfo/theme-reviewers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wordpress.org/pipermail/theme-reviewers/attachments/20140428/9914864c/attachment.html>


More information about the theme-reviewers mailing list