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 1 year, 2 months ago.

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

    heathermiller
    Participant
    Post count: 1

    Hi
    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.

    #48489

    braddalton
    Participant
    Post count: 9794

    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:
    [php]
    function add_header_genesis() {
    echo ‘<div class="add-header">"wp-sites-logo"</div>’;
    };
    add_action(‘genesis_header’, ‘add_header_genesis’);
    [/php]

    You can see the image alt in this HTML:
    [html]
    img alt="wp-sites-logo"
    [/html]


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

You must be logged in to reply to this topic.