How to edit and save changes to inspect element

I want to add alt attribute to logo in Inspect element and save it permanently. How can I do it?
Can you help me to resolve it

Hi,

In Inspect Element you can’t save changes, but if you want to modify the logo’s “alt attribute”, then please edit header.php file on line 41 and change the default alt attribute in this code:

<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php bloginfo('name'); ?>"><img class="site-logo" src="<?php echo esc_url(get_theme_mod('site_logo')); ?>" alt="<?php bloginfo('name'); ?>" /></a>

Replace <?php bloginfo('name'); ?> after alt=" and let me know how it works.

Kind Regards,
Csaba

1 Like

Hu,

<?php bloginfo('name'); ?> This is already there in header.php

<?php bloginfo('name'); ?>
so what do I do

Hi,

You must replace that code with your own text, so what you write in place of <?php bloginfo('name'); ?> will show as alt text for your logo image.

Kind Regards,
Csaba

Sorry for the delay.
But I have still not been able to sort it out.
In the editor for header php I have added Kitchen-Faucet-Logo

<?php bloginfo (Kitchen-Faucet-Logo); ?>

In the Inspect element it is showing as

https://kitchenfaucetswithsprayer.com

Bing is still showing

The tag does not have an ALT attribute defined.

Recommended Action:
Use the attribute to write descriptive content for the image: <img source=“pic.gif” alt=“Accurate and descriptive keyword text that represents the image.”.
I am totally confused.
Please help what to do?

Hi,

No, that’s wrong, I’ve meant to replace the whole code <?php bloginfo('name'); ?> with your text, so the full image code should look like this:

<a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php bloginfo('name'); ?>"><img class="site-logo" src="<?php echo esc_url(get_theme_mod('site_logo')); ?>" alt="YOUR TEXT GOES HERE" /></a>

Kind Regards,
Csaba

   Hi I sorted the problem. Crwl error is still showing alt error.

In page source
I find the following HTML where alt=""




I do not kknow what it is?

The html code is not coming in my reply
Thee code is basically this:
header – #masthead
div class=“sydney-hero-area"
div class=“header-image” img class=“header-inner” src=”" width=“1920” alt="" title="" /div

Hi,

If you want to add text to the alt tag in that code too, then please add any text you want inside "" after alt=", like this:

<div class=“header-image” img class=“header-inner” src=”" width=“1920” alt="YOUR TEXT HERE" title="" </div>

Kind Regards,
Csaba

Hi, Sorry for the delay in replying. I was unwell.
The HTML code is actually appearing in the Page source. I am not able to edit this. How do I do it?

Hi,

Where did you tried to edit the code?

Kind Regards,
Csaba

Hi,
In the page source.
The changes do not take place permanently.
what di I do
Regards,
Anand

Hi,

You must edit the code using a code editor, please access your cPanel and use File Manager to access header.php file and use a Code / HTML Editor to edit the code, or you can edit header.php in wp-admin -> Appearance -> Edit ( Code editor may be better for beginners ).

Kind Regards,
Csaba

Hi Csaba,
Thanks for the advice.
I have deleted this portion because I am not using a slider image

Kind Regards,
Anand

Hi,

Ok. You’re most welcome! If you need help with anything else, please open a new topic.

Have a nice day!

Kind Regards,
Csaba