Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I'm trying to customize the look of the iframe that pops up (media uploader).

I've manage to remove some fields etc - but I cannot re-size the frame, does anybody know how to do this?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

The default media box has hard coded HTML values so in order to alter the CSS for it you you have 2 options.

  1. Enqueue your own CSS and override the values
  2. Disable media-views.css completely and load a custom stylesheet.

To enqueue your own style:

function blah_admin_css() {
    wp_enqueue_style( 'blah_admin_css', path to your custom.css );
}
add_action('admin_print_styles', 'blah_admin_css' );

Now just add whatever you want to a custom.css file to override the CSS values, you might have to use the dreaded !important.

To completely disable the admin CSS from loading for the media box you need to hook into wp_default_styles and the name which happens to be media-views.

For example:

function remove_media_style($wp_styles ){
    $wp_styles->remove('media-views');
}
add_action('wp_default_styles', 'remove_media_style');

You should use a plugin to do this since you just have to disable it to revert back to the original style.

ps. There is a 3rd option, just use javascript, and generally speaking all 3 options are a bad idea.

share|improve this answer
    
Thanks for the help, the problem is I am already pulling in a custom CSS file BUT the styles I want to change are inline which means the CSS file just gets over written –  RICKY DAWN Jun 14 '13 at 8:41
    
The default media box styles aren't inline, you can override them using !important unless you have javascript turned off. –  Wyck Jun 14 '13 at 15:28
    
Nice thanks, I'll give it a try –  RICKY DAWN Jun 14 '13 at 20:59

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.