• Resolved Irene

    (@arlinaite)


    Some body could help please?
    I have a hueman child theme and the code seames to be ok, the image alt atribute is in the code but don’t shows in post source code.
    I use in the header the head-image (instead of logo and description)
    This is the code in header

    <?php if ( ot_get_option('header-image') == '' ): ?>
    				<div class="group pad">
    					<?php echo alx_site_title(); ?>
    					<?php if ( ot_get_option('site-description') != 'off' ): ?><p class="site-description"><?php bloginfo( 'description' ); ?></p><?php endif; ?>
    				</div>
    				<?php endif; ?>
    				<?php if ( ot_get_option('header-image') ): ?>
    					<a href="<?php echo home_url('/'); ?>" rel="home">
    						<img class="site-image" src="<?php echo ot_get_option('header-image'); ?>" alt="<?php get_bloginfo('name'); ?>">
    					</a>
    				<?php endif; ?>

    Same problem in footer.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi arlinaite. This problem was reported a while ago. The fix is the same for both the header and the footer. Until the theme is updated you can correct the problem with the following changes:
    1. Copy the files header.php and footer.php from the parent theme to a child theme.
    2. In the child theme header.php locate this section of code about 2/3 of the way down:

    <?php if ( ot_get_option('header-image') ): ?>
       <a href="<?php echo home_url('/'); ?>" rel="home">
          <img class="site-image" src="<?php echo ot_get_option('header-image'); ?>" alt="<?php get_bloginfo('name'); ?>">
       </a>
    <?php endif; ?>

    3. In footer.php locate this section of code about 3/4 of the way down:

    <div class="grid one-half">
       <?php if ( ot_get_option('footer-logo') ): ?>
          <img id="footer-logo" src="<?php echo ot_get_option('footer-logo'); ?>" alt="<?php get_bloginfo('name'); ?>">
    <?php endif; ?>

    4. In both of those code blocks, change this:

    alt="<?php get_bloginfo('name'); ?>">

    to this:

    alt="<?php echo get_bloginfo('name'); ?>">

    That should set the image <alt> attribute to whatever you have in Settings > General > Site Title.

    Thread Starter Irene

    (@arlinaite)

    Hi bdbrown
    Great!!! Very clear! Thank’s a lot.
    I follow your help also for the gravatar thing in the author box.
    Every thing is ok except that alt attribute don’t display for the image gravatar.
    I didn’t find where to feel the alt tag for the gravatar for shore you know.
    Thank’s once more for your help!

    For the avatar:
    1. Copy single.php to your child theme.
    2. Find this block of code:

    <div class="author-bio">
    	<div class="bio-avatar"><?php echo get_avatar(get_the_author_meta('user_email'),'128'); ?></div>
    	<p class="bio-name"><?php the_author_meta('display_name'); ?></p>
    	<p class="bio-desc"><?php the_author_meta('description'); ?></p>
    	<div class="clear"></div>
    </div>

    3. Change this:

    <?php echo get_avatar(get_the_author_meta('user_email'),'128'); ?>

    to this:

    <?php echo get_avatar(get_the_author_meta('user_email'),'128','',get_the_author_meta('user_firstname').' '.get_the_author_meta('user_lastname')); ?>

    That will put the author’s first and last names in the alt attribute. There are several other author_meta parameters you can use; they are described on this Codex page.

    Thread Starter Irene

    (@arlinaite)

    Hi bdbrown

    Thank’s once more! great help!
    Now is working properly.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘No alt tag in image-header and footer’ is closed to new replies.