I'm using a custom header in my theme. My aim is to add an alt
attribute to my custom header img
element. My img
element so far looks like this:
<img src="<?php header_image(); ?>" height="<?php echo get_custom_header()->height; ?>" width="<?php echo get_custom_header()->width; ?>" alt="" />
How can I get the alt text of the custom header image?
get_custom_header()->alt
, but that's not the case, as far as I can see after skimming through the source ;-) But fortunately @TheDeadMedic found a great work around.get_custom_header()->alt
. Thanks to @TheDeadMedic for the solution.