Home page slide image missing ALT

resolved (15 posts) (3 voices)

  1. This is similar to my previous post here, but it's about slide image on home page which is missing ALT tag.

    Before I continue to write about it, just to say that I'm using only one image in slider, so there is no sliding at all. So, I have changed a litle bit file featured-custom.php.

    Original part of code:

    <div style="position:absolute;right:0;top:0;margin:20px 0 0 0;">
    				<a>" class="load_slider_img">
    					<span class="rm_portfolio_img"><img src="<?php echo $custome_image; ?>" alt="" /></span>
    					<span class="slider_frame"></span>
    				</a>
    			</div>

    is replaced with this one:

    <div style="position:absolute;right:0;top:0;margin:20px 0 0 0;">
    				<a href="http://electrical-engineering-portal.com/technical-articles">
    					<span class="rm_portfolio_img"><img title="EEP" src="http://electrical-engineering-portal.com/wp-content/uploads/intro-image/eep-intro-07.jpg" alt="EEP" width="600" height="340" /></span>
    					<span class="slider_frame"></span>
    				</a>
    			</div>

    I put exact image insted of variable $custome_image. Now my question is simliar like previous one. ALT tag is written well (alt="EEP"), but in page source it's missing (it shows Alt="").

    What should be changed additionally?

    Posted 11 months ago #
  2. Not to forget homepage link: http://electrical-engineering-portal.com

    Posted 11 months ago #
  3. Elliott
    Support

    Hello csanyigroup,

    Here are instructions for Awake, http://mysitemyway.com/support/topic/seo-adding-alt-image-information-in-homepage-slider

    For inFocus its in /wp-content/themes/infocus/lib/scripts/custom.js and on lines 382, 428. Except for inFocus line 428 needs to look like this,

    }).attr('src', jQuery($images[index]).attr('src')).attr('class', jQuery($images[index]).attr('class')).attr('alt', jQuery($images[index]).attr('alt'));

    Posted 11 months ago #
  4. It's not pretty much clear form me. Should I replace the line:

    }).attr('src', jQuery($images[index]).attr('src'));

    with your suggestion:

    }).attr('src', jQuery($images[index]).attr('src')).attr('class', jQuery($images[index]).attr('class')).attr('alt', jQuery($images[index]).attr('alt'));
    Posted 11 months ago #
  5. Elliott
    Support

    Yep, and make sure to comment out line 382.

    Posted 11 months ago #
  6. What exactly is line 382?

    I have change a lot since I installed inFocus.

    Posted 11 months ago #
  7. Elliott
    Support

    See here, http://mysitemyway.com/support/topic/seo-adding-alt-image-information-in-homepage-slider

    Line 382 looks like this,

    jQuery(this).attr({alt: ""});

    Posted 11 months ago #
  8. Works great Elliott! Thanks very much!

    Can I ask you for one more issue related to missing alt tags. It's on the blog and archive pages. What should I change to get alt tags of post images on these pages.

    Here are links:
    Blog: http://electrical-engineering-portal.com/technical-articles
    Archive: http://electrical-engineering-portal.com/category/energy-and-power

    Thanks in advance! You and your fellows are really awsome technical support!

    Posted 11 months ago #
  9. Hi csanyigroup,

    open up wp-content/themes/infocus/lib/includes/template-blog.php and replace line 198:
    <span class="rm_portfolio_img noscript"><img src="<?php echo $post_image; ?>" alt="" /></span>
    with this:
    <span class="rm_portfolio_img noscript"><img src="<?php echo $post_image; ?>" alt="<?php echo stripslashes($post->post_title); ?>" /></span>

    Then, you need to do the exact same thing at line 193 of wp-content/themes/infocus/archive.php.

    Let us know if this worked for you.

    Posted 11 months ago #
  10. It's not working. Alt still missing in the both blog and archive page.

    Posted 11 months ago #
  11. Hi csanyigroup,

    the reason why you don't see the alt tag is the same I explained on the other topic.

    The preloading script remove the alt tag, but you can look at it in the source code.

    Posted 11 months ago #
  12. Maybe this is true, but Firefox doesn't see this alt tags after page is loaded. When blog page is loaded and you see the HTML output, you'll see Alt="".

    Posted 11 months ago #
  13. Elliott
    Support

    As Raspo said the alt tags are indeed being loaded, its just that the preload script is taking them off after the page is done so if your using firebug then you won't see them.

    I took this example out of your page source,

    <img src="http://electrical-engineering-portal.com/wp-content/themes/infocus/lib/scripts/thumb.php?src=http://electrical-engineering-portal.com/wp-content/uploads/thumbs-down-to-the-nuclear-energy.jpg&w=230&h=150&zc=1&q=100" alt="Article image" />

    If you want to change the preload script then you will need to do the same thing we did before in /wp-content/themes/infocus/lib/includes/template-blog.php on line 88,

    }).attr('src', jQuery($images[index]).attr('src'));

    Let us know if this helps csanyigroup.

    Posted 11 months ago #
  14. This way is working! Thanks Elliott!

    Can I ask you and Raspo what is the advantage of preload script to remove alt tags after the page load?
    It's not pretty clear for me, I mean, if the speed of loading page is not an issue, what would be 'bright' side of it?

    Thanks guys!

    Posted 11 months ago #
  15. Elliott
    Support

    To my knowledge it is just a quirk of this specific preload script. In the next update we use the Wordpress "Featured Image" so you will be able to set the alt and title text as you upload your image.

    Posted 11 months ago #

Reply

You must log in to post.

Construct WordPress Theme
Construct wordpress theme
Myriad WordPress Theme
Myriad wordpress theme
Method WordPress Theme
Method wordpress theme
Fusion WordPress Theme
Fusion wordpress theme
Elegance WordPress Theme
Elegance wordpress theme
Echelon WordPress Theme
Echelon wordpress theme
Dejavu WordPress Theme
Dejavu wordpress theme
Modular WordPress Theme
Modular wordpress theme