• Creator
    Topic
  • #24717

    Jeff Hoffman
    Participant
    Been thanked: 0 times

    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.

Viewing 12 replies - 1 through 12 (of 12 total)
Replies
  • Denzel Chia
    Moderator
    Post count: 2871
    Been thanked: 94 times
    #24735 |

    Hi,

    You can add in header.php line 177 and 179

    Thank you

    Jeff Hoffman
    Participant
    Post count: 37
    Been thanked: 0 times
    #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
    Post count: 2871
    Been thanked: 94 times
    #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
    Participant
    Post count: 37
    Been thanked: 0 times
    #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
    Post count: 2871
    Been thanked: 94 times
    #24786 |

    Hi,

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

    And add alt to the img tag..

    Thank you

    Jeff Hoffman
    Participant
    Post count: 37
    Been thanked: 0 times
    #24793 |

    Thanks, I will try this.

    Denzel Chia
    Moderator
    Post count: 2871
    Been thanked: 94 times
    #24861 |

    You are welcome!

    Jeff Hoffman
    Participant
    Post count: 37
    Been thanked: 0 times
    #24872 |

    Thanks but it appears that did not work.

    Denzel Chia
    Moderator
    Post count: 2871
    Been thanked: 94 times
    #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
    Post count: 15
    Been thanked: 0 times
    #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.

    Daniel Jones
    Moderator
    Post count: 241
    Been thanked: 18 times
    #28102 |

    Hi Mike,
    Thanks for contacting us.

    The code shared by Denzel should work for you, try it out.

    You can update the theme without losing any customized codes by using the give instruction in the articles below:
    http://www.wpbeginner.com/wp-themes/how-to-update-a-wordpress-theme-without-losing-customization/.
    https://cohhe.com/update-wordpress-themes-without-losing-customizations/.

    I hope that helps.
    Please let me know if there’s any other problem, I’m glad to help.

    Roman
    Keymaster
    Post count: 2538
    Been thanked: 29 times
    #28103 |

    this SEO issue will be fixed in the next theme release 😉

    1 user thanked author for this post.
Viewing 12 replies - 1 through 12 (of 12 total)
You must be logged in to reply to this topic.