WordPress.org

Forums

issue with get_custom_header returing 0 for height/width (1 post)

  1. golden-eye
    Member
    Posted 1 year ago #

    when useing get_custom_header the array returns the height and width as 0px

    in my functions.php i have

    $headerDefaults = array(
    	'default-image' => get_template_directory_uri() . '/images/header.png',
    	'random-default'         => false,
    	'flex-height'            => false,
    	'flex-width'             => true,
    	'uploads'                => true,
    		'width'         => 450,
    		'height'        => 150,
    );

    in my header.php i have

    <img src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" alt="" />
    the array returns

    stdClass Object
    (
        [url] => http://democustom.globalclassroomportal.com/wp-content/uploads/sites/9/2014/07/demo-custom-logo1.png
        [thumbnail_url] => http://www.msite.com/wp-content/uploads/sites/9/2014/07/demo-custom-logo1.png
        [width] => 0
        [height] => 0
        [attachment_id] => 231
    )

Topic Closed

This topic has been closed to new replies.

About this Topic