• Closed
  • Jeff Hoffman
    Spectator
    February 26, 2016 at 4:23 pm #24717

    I would like to add an alt tag to my image in the header for SEO reasons. I have it in the image in the library but seems there is no attribute to it in the header.

    Denzel Chia
    Moderator
    Posts: 2656
    February 27, 2016 at 2:58 am #24735

    Hi,

    You can add in header.php line 177 and 179

    Thank you

    Jeff Hoffman
    Spectator
    Posts: 47
    February 27, 2016 at 3:34 am #24738

    Sorry but I am new and/or paranoid about editing php.
    So I would add something like this?

    Header text

    to line 177 and 179 below?

    /*
    <!– /.cart-contents –>

    <?php endif;//if(!$woocommerce->cart->cart_contents_count): ?>
    LINE 177
    <!– /li.cart –>
    LINE 179
    <?php endif;//if($woocommerce_cart_link_main_nav): ?>

    <!– /ul.woocommerce-menu –>
    </span><!– /span .woocommerce-menu-holder –>

    */

    Denzel Chia
    Moderator
    Posts: 2656
    February 27, 2016 at 5:06 am #24739

    Hi,

    Please hire a developer to assist in this customization.
    We can only provide assistance in customization that is possible using custom css.
    You would require editing theme code to add alt tag to header image HTML code, it not possible to do this using custom css.

    Thank you

    Jeff Hoffman
    Spectator
    Posts: 47
    February 27, 2016 at 2:54 pm #24742

    Thanks but that is disappointing. I don’t know anything about building themes but the alt tag is basic SEO and should be included.

    Denzel Chia
    Moderator
    Posts: 2656
    February 28, 2016 at 8:51 am #24786

    Hi,

    You can open up header.php, find the following codes.

    echo "<div class='header-logo-container clearfix'><a href=" . home_url() . "><img id='logo-image' class='img-responsive' src=" . $evolve_header_logo . " /></a></div>";
    } else {
    echo "<div class='header-logo-container'><a href=" . home_url() . "><img id='logo-image' class='img-responsive' src=" . $evolve_header_logo . " /></a></div>";

    And add alt to the img tag..

    echo "<div class='header-logo-container clearfix'><a href=" . home_url() . "><img id='logo-image' alt='logo' class='img-responsive' src=" . $evolve_header_logo . " /></a></div>";
    } else {
    echo "<div class='header-logo-container'><a href=" . home_url() . "><img id='logo-image' alt='logo' class='img-responsive' src=" . $evolve_header_logo . " /></a></div>";

    Thank you

    Jeff Hoffman
    Spectator
    Posts: 47
    February 29, 2016 at 1:16 am #24793

    Thanks, I will try this.

    Denzel Chia
    Moderator
    Posts: 2656
    March 1, 2016 at 12:34 am #24861

    You are welcome!

    Jeff Hoffman
    Spectator
    Posts: 47
    March 1, 2016 at 5:13 pm #24872

    Thanks but it appears that did not work.

    Denzel Chia
    Moderator
    Posts: 2656
    March 1, 2016 at 11:52 pm #24880

    Hi,

    That’s not possible.
    You can look at the codes in header.php
    That’s the code for logo.

    If you have a cache plugin, clear your cache.
    Please hire a developer is you require further assistance.

    Thank you.

    Mike Barkas
    Spectator
    Posts: 15
    May 26, 2016 at 7:57 am #28006

    I have the same issue, i looked in the header.php in the editor and used the find function and nothing comes up. I am a bit surprised this is not standard to enter in an alt text for your header since its much needed for SEO. Any way to do it with updates that have been done since?

    Also if theme updates and the changes are made. Does it wipe out the change?

    I think this is an important issue that needs to be fixed

    SEMRUSH is reporting it as a serious issue that should be addressed.