Alt attribute for loading.gif
-
Can you please add alt to loading.gif in line 101 of wp-postratings.php?
HTML validator gives me multiple errors because of this.
Thank you.
-
It was there previously and I removed it because Google will index the loading alt text and I have more complains on that.
Can you add a filter hook for that then?
Sounds good. Added it to the dev version https://github.com/lesterchan/wp-postratings/archive/master.zip
Commit: https://github.com/lesterchan/wp-postratings/commit/14f06fbb16cf78ca5d85c4e587228f9b1dc16bfe
Thank you very much!
It works!
But the alt is in div tags not img…
Can you please fix it?
Yeap i realized that it is fixed in the commit
Hello @gamerz @takuyoshi ,
I came here to ask how to disable alt and title but seeing your request made me rethink about it. (I have added the filter to remove it but as I have 2 instances of the rating function in each page and it only works for the first instance, I was thinking about deleting it directly in the code.)
Why is it important to have alt and title on those images that are not bringing any semantic value to content as it is only ‘illustration’ images ? Is google taking those images into account to add signals about the rating feature of the pages ?
>Why is it important to have alt and title on those images
I use alt only because HTML Validator tells me to do it. So don’t follow me for this. I just do it. There might be more cons than pros.
Title is a pure utility for me. I use it when text-overflow: ellipsis is there.
When you hover a cursor over truncated letters you can read the whole text through the title attribute. That’s useful don’t you think?
-
This reply was modified 6 years, 10 months ago by
takuyoshi.
@takuyoshi
Thank you for the reply.I totally agree for the title tag. It is very important for accessibility purposes (in fact I thought about it after posting, didn’t want to rewrite the post), this one cannot be removed.
About the alt and w3c ok, I understand your point of view.
Just a question, is there a reason to follow their rules or is it “just for you” ?
What is your reason ?@rom174 Hi.
It’s simply a fact that I don’t like HTML Validation Errors.
That’s all to it.
If you are talking about SEO or that kinda thing with regard to alt attributes, you really shouldn’t focus too much on it.
It’s so much more important to improve your Site contents.
Google apparently observes how much time visitors spend on your Site, how much content they see through scrolling and other things like these.
If HTML errors would make a site content unreadable, that would be a huge problem. Modern browsers, however, correct pretty much all HTML anomalies for viewers anyway (for instance inserting a closing tag if missing).
So please take it easy.
Yes sure even if not talking about seo, accessibility stays important for user using page reader and other purpose.
Thank you for your precisions.
Hi. It’s working like a charm!
Thank you so much 🙂
Can you possibly create a new version based on this fix?
Yeap, will do a release when more fixes are in =)
Can you also add Schema to your code?
It would be something like this.
<div itemprop="aggregateRating" itemscope itemtype="https://schema.org/AggregateRating"> <em> <b><span itemprop="reviewCount">1</span></b> votes, average: <b><span itemprop="ratingValue">5.00</span></b> out of <span itemprop="bestRating">5</span>, <b>rated</b></span> </em> </div>But some people might not want this. So it will be great if there’s a checkbox in the setting to turn the function on and off.
P.S. I use ‘b’ rather than ‘strong’ because the latter one apparently has SEO values that should be applied only to important texts not just numbers which have no meaning independently.
I want to avoid options, as it is quite a bit of work to add it. For advanced users, they can basically do this via the rating template filter?
Hi.
I used one of the templates like this.
<div itemprop="aggregateRating" itemscope itemtype="https://schema.org/AggregateRating"> %RATINGS_IMAGES% (<em> <b><span itemprop="reviewCount">%RATINGS_USERS%</span></b> votes, average: <b><span itemprop="ratingValue">%RATINGS_AVERAGE%</span></b> out of <span itemprop="bestRating">%RATINGS_MAX%</span>, <b>rated</b></span> </em>) </div>But whenever I save it I get this.
<div> %RATINGS_IMAGES% (<em> <b><span>%RATINGS_USERS%</span></b> votes, average: <b><span>%RATINGS_AVERAGE%</span></b> out of <span>%RATINGS_MAX%</span>, <b>rated</b></span> </em>) </div>All item* things will be removed.
Why’s that?
-
This reply was modified 6 years, 10 months ago by
The topic ‘Alt attribute for loading.gif’ is closed to new replies.