Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on May 4th, 2012  |  syntax: None  |  size: 0.90 KB  |  hits: 10  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Overriding parent function in WordPress
  2. // Set image sizes upon theme activation
  3. if(! function_exists( 'theme_image_setup' )):
  4.     function theme_image_setup() {
  5.         // updating thumbnail and image sizes
  6.         update_option('thumbnail_size_w', 200);
  7.         update_option('thumbnail_size_h', 150);
  8.         update_option('medium_size_w', 620);
  9.         update_option('medium_size_h', '');
  10.         update_option('large_size_w', 940);
  11.         update_option('large_size_h', '');
  12.     }
  13. endif;
  14.  
  15. add_action( 'switch_theme', 'theme_image_setup' );
  16.        
  17. function theme_image_setup() {
  18.     // updating thumbnail and image sizes
  19.     update_option( 'thumbnail_size_w', 150, true );
  20.     update_option( 'thumbnail_size_h', 150, true );
  21.     update_option( 'medium_size_w', 620, true );
  22.     update_option( 'medium_size_h', '', true );
  23.     update_option( 'large_size_w', '', true );
  24.     update_option( 'large_size_h', 500, true );
  25. }