Home page image attributes missing

Support Area Forums Moonrise Home page image attributes missing

Viewing 2 posts - 1 through 2 (of 2 total)
URL to the page in question: http://splashlightmarketing.com
  • Author
    Posts
  • #30767
    Christine Donalies
    Participant

    Hi Bill,

    In Theme Options, my header logo image and 4 home page images are missing width and/or height attributes and slowing my site. These dimensions are set in my image library for these images so I’m perplexed. Where do I fix this?

    Thanks for your help~
    Christine

    #30772
    Bill Robbins
    Moderator

    Hey Christine,

    It’s not slowing down your site in any appreciable way. You may have a suggestion in a performance review for that, but it’s not going to slow down the drawing of your site by the browser.

    What those attributes do is reserve space for an image. Your logo is so small both file size and dimension wise that it will be there as soon as the page is visible to your visitors.

    If you really want to add them though you can. First edit your header.php file.

    This section is for the logo:

    
    <div id="logo"><?php
    	if (is_front_page()) {
    		echo '<h1><a href="'.home_url().'/"><img src="'.of_get_option('logo','').'" alt="'.get_bloginfo('name').'" /></a></h1>';
    	} else {
    		echo '<p><a href="'.home_url().'/"><img src="'.of_get_option('logo','').'" alt="'.get_bloginfo('name').'" /></a></p>';
    	}
    ?>
    </div>
    

    You can add the height and width of your image logo to the two image tags there.

    The home block ones are background images on desktop sized displays. If you want to add the height and width for the smaller screen version you can. Edit the page-home.php file. The calls to those images look like this:

    
    <img src="<?php echo of_get_option('section_image_6'); ?>" alt="" />
    

    Feel free to add the sizes to those too.

    Take care,
    Bill

Viewing 2 posts - 1 through 2 (of 2 total)
  • The topic ‘Home page image attributes missing’ is closed to new replies.