Site icon WP Smith

Permenantly Fix Genesis's Admin Metabox Widths

In the StudioPress Support Forum, Charles Clarkson helped me with a problem that I've had for some time now. I have wanted StudioPress to change their .genesis-metaboxes .metabox-holder from its default of 800px to auto on the Theme Settings under Genesis tab (http://yourdomain.com/wp-admin/admin.php?page=genesis).

Genesis Default (800px): Click Image for Larger Image

However, after every upgrade I had to edit the admin.css to make this happen.

My Preference (auto): Click Image for Larger Image

So finally I posted this in the forums and Charles gave me the following code to free me from remembering to do that. And here it is:

[php]
add_action( 'admin_footer', 'child_widen_theme_settings' );
function child_widen_theme_settings() { ?>
<script type="text/javascript">
//<![CDATA[
jQuery(document).ready( function($) {
$( '.genesis-metaboxes, .genesis-metaboxes .metabox-holder' ).css( 'width', 'auto' );
//]]>
});
</script>
<?php
} [/php]