title: PHP getimagesize is not working when is called from a function in function.php (Wordpress)?
body: <p>PHP getimagesize is not working when is called from a function in <code>function.php</code>.</p>
  
  <p><strong>function.php:</strong></p>
  
  <pre><code>&lt;?php
  
      // Theme Options
      require_once(TEMPLATEPATH . '/functions/admin-menu.php');
  
      add_action('wp_head', 'theme_options', 'get_image_size');
  
      function theme_options() {
          // Initiate Theme Options
          $options = get_option('plugin_options');
  
          // If a logo image was uploaded then remove text from site title
          if ($options['logo'] != NULL)
              $remove_text = '-9999px';
  
          else
              $remove_text = 0;
  
          ?&gt;&lt;style&gt;
          body {
              background-color: &lt;?php echo $options['color_scheme']; ?&gt;
          }
  
          #header h1 a {
              background: url(&lt;?php echo $options['logo']; ?&gt;) no-repeat scroll 0 0;
              text-indent: &lt;?php echo $remove_text; ?&gt;;
          }
          &lt;/style&gt;&lt;?php
      }
  
      function get_image_size() {
  
          list($width, $height, $type, $attr) = getimagesize($options['logo']);
  
          echo "Image width " .$width;
          echo "&lt;BR&gt;";
          echo "Image height " .$height;
          echo "&lt;BR&gt;";
  
          var_dump($width);
          var_dump($heigt);
      }
  </code></pre>
  
  <p><code>$options['logo']</code> is returning <code>http://localhost/wordpress/wp-content/uploads/2010/12/logo4.png</code> so the image is being displayed.</p>
  
  <p>I also did <code>var_dump</code> to <code>$width</code> and <code>$height</code> but they didn't show up.</p>
  
  <p>Any suggestions?</p>
  
  <p><strong>EDIT: I pasted the full code of <code>functions.php</code>.  <code>$options['logo']</code> works perfectly in the <code>theme_option</code> function so I don't know why it doesn't work in the <code>get_image_size</code> function.</strong></p>