I have a few missing attributes in my WP Theme.
I found images in header.php in example:
class="articles"><img src="<?php echo get_template_directory_uri(); ?>/images/topmenu/ikona_artykuly.png" />
ikona_artykuly.png
has missing attribute.
Can I add alt attribute in this place?
class="articles"><img src="<?php echo get_template_directory_uri(); ?>/images/topmenu/ikona_artykuly.png" alt="Artykuly" />
Will it be ok, or this is not the right place to add alt attribute?
Can you help?
Regards, Marceli
I have a few missing attributes in my WP Theme.
I found images in header.php in example:
class="articles"><img src="<?php echo get_template_directory_uri(); ?>/images/topmenu/ikona_artykuly.png" />
ikona_artykuly.png
has missing attribute.
Can I add alt attribute in this place?
class="articles"><img src="<?php echo get_template_directory_uri(); ?>/images/topmenu/ikona_artykuly.png" alt="Artykuly" />
Will it be ok, or this is not the right place to add alt attribute?
Can you help?
Regards, Marceli
Share Improve this question edited Dec 29, 2019 at 15:54 fuxia♦ 107k39 gold badges255 silver badges459 bronze badges asked Dec 29, 2019 at 15:30 wordheawordhea 11 Answer
Reset to default 0Yes, you can add the alt attribute. But there is a catch.
When the theme is updated, all your changes or modification to the theme will be lost.
It is recommended to make those changes in the child theme. You can learn more about WordPress child theme here