PHP getimagesize is not working when is called from a function in function.php (Wordpress)?
- by janoChen
PHP getimagesize is not working when is called from a function in function.php.
function.php:
add_action('wp_head', 'get_image_size');
function get_image_size() {
global $width; // I thought this would solve the problem but it didn't
global $height; // I thought this would solve the problem but it didn't
list($width, $height, $type, $attr) = getimagesize($options['logo']);
echo "Image width " .$width;
echo "<BR>";
echo "Image height " .$height;
echo "<BR>";
}
$options['logo'] is returning http://localhost/wordpress/wp-content/uploads/2010/12/logo4.png so the image is being displayed.
I also did var_dump to $width and $height but they didn't show up.
Any suggestions?