Settings in ‘Media > Settings’ is ignored when inserting images

I believe your issue is that the value set for the global $content_width variable (which is 640px in Boilerplate and 584px in Twenty Eleven) is less than the width you’re specifying via Settings -> Media.

WordPress is overriding your user setting with the Theme-specific value. This actually makes sense, since a Theme knows its maximum content width, and using a larger image width than what the Theme is designed to accommodate would very likely break the Theme layout.

The solution, then, if you need to change the large image width to 690px (and assuming your Child Theme can accommodate this width), is to define $content_width in your Child Theme functions.php file. I would recommend using a Child Theme setup function, hooked into after_setup_theme(), like so:

<?php
function wpse48075_theme_setup() {
    // Define $content_width global
    global $content_width;
    if ( ! isset( $content_width ) ) {
        $content_width = 690;
    }
}
add_action( 'after_setup_theme', 'wpse48075_theme_setup', 9 );
?>

The priority 9 is probably overkill, since your Child Theme’s actions will be added before the parent Theme’s actions anyway; but using priority 9 will guarantee that this action fires before the parent Theme setup fires, at priority 10.

Since your Child Theme action fires first, the Child Theme defines $content_width, and the Parent Theme does not override it (since it also uses a if ( ! isset() ) conditional wrapper).

Edit

So, looking at the Twenty Eleven functions.php file, I realized I made a bad assumption: Twenty Eleven defines $content_width nakedly in functions.php, rather than inside the Theme setup function, hooked into after_setup_theme. So, to override it, ** you have to do likewise**.

Just put the following at the top of your functions.php file, before any other function definitions:

$content_width = 690;

This should work, since the Child Theme functions.php gets parsed before the Parent Theme functions.php.

(This is a prime example of why Themes should wrap all the things inside callbacks. 🙂 )

Leave a Comment