Alt tags empty on header image
-
Hi I have noticed that the header images are not showing any text in the alt tags. I have found the function in functions.php as below but can’t figure what i need to put in the alt tags to get them to show. Can anyone please advise?
function bavotasan_header_images() { global $post; $post_id = ( is_attachment() && isset( $post->post_parent ) ) ? $post->post_parent : get_queried_object_id(); $custom_image = ( is_singular() || get_option( 'page_for_posts' ) == $post_id || is_attachment() ) ? get_post_meta( $post_id, 'arcade_basic_custom_image', true ) : ''; if ( $custom_image ) { echo '<img src="' . esc_url( $custom_image ) . '" alt="" class="header-img" />'; } else { if ( $header_image = get_header_image() ) : ?> <img class="header-img" src="<?php header_image(); ?>" alt="<?php echo( get_post_meta( $post_id, 'meta_value', true ) ); ?>" /> <?php endif; } }
Thanks in advance.
Dave.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Alt tags empty on header image’ is closed to new replies.