Alt tag to Header

Community Forums Forums Design Tips and Tricks Alt tag to Header

This topic is: not resolved

This topic contains 1 reply, has 2 voices, and was last updated by  braddalton 9 months, 3 weeks ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
  • #48478

    Post count: 1

    I have the sample child theme. My SEO software is saying I don’t have an alt tag on my header image. I was told by customer service to go to settings>general and I filled out the tagline but that isn’t helping. I have WordPress SEO by Yoast. Can someone please help me add an alt tag to my header? The sample child theme has no header.php.


    Post count: 7458

    Can you link to your site please.

    How did you add the header image to the theme?

    You can add the alt text using a custom function:

    function add_header_genesis() {
        echo '<div class="add-header"><a href=""//""><img alt=""wp-sites-logo"" src="""//"" width=""1152"" height=""69"" /></a></div>';
    add_action('genesis_header', 'add_header_genesis');

    You can see the image alt in this HTML:

    img alt="wp-sites-logo" 

    WordPress Developer & Consultant
    Brad Dalton400+ StudioPress Tutorials & 1200+ Code snippets

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.