All ‘Maintain-Website’ Postings

Validating WordPress Single Post

Error Line 117, Column 95: there is no attribute “aria-required”

…me=”author” id=”author” value=”" size=”22″ tabindex=”1″ aria-required=’true’ />

Ever since this line was in the comments.php, my blog no longer validates.
I have always ignored it.
If it benefits the visitors, I’ll live with it.

But suddenly, this Invalid Markup bothers me today. It must have been 2 years.
Someone must have moved too fast and someone else moved too slow.
2 years and still behind. It must be a case of :

  • It is not important
  • It is important but is not urgent
  • It is important and urgent but does not required immediate attention and action

So I opened up comment.php and search for <aria-required> I found these 2 lines:

<p><input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1" <?php if ($req) echo "aria-required='true'"; ?> />
<label for="author"><small>Name <?php if ($req) echo "(required)"; ?></small></label></p>
<p><input type="text" name="email" id="email" value="<?php echo esc_attr($comment_author_email); ?>" size="22" tabindex="2" <?php if ($req) echo "aria-required='true'"; ?> />
<label for="email"><small>Mail (will not be published) <?php if ($req) echo "(required)"; ?></small></label></p>

I had these 2 lines of php code removed

<?php if ($req) echo "aria-required='true'"; ?>

Now there’s a line that says
<?php if ($req) echo "(required)"; ?>

I don’t understand PHP but I feel this line should go too.

Since it’s done, I’ll go fill in a comment and see if there’s anything wrong.

It’s good the see this line again:

This document was successfully checked as XHTML 1.0 Transitional!

Validating Google Custom Search

Finally I am able to have every page passed the XHTML validation.

Previously, one line didn’t validate. It was a code supplied by Google:

<style type="text/css">
@import url(http://www.google.com/cse/api/branding.css);
</style>

This code shouldn’t be in the content area.

I could have the page validated by moving this style link to the <head> section – there’s where it should be. However that would violates the Adsense TOS.

While doing a search I came across this WebMasterWorld Forum when a member discovered the solution after posting about this problem.

Instead of moving the code, the simple solution is to select a different set of code provided by Google; i.e. to opt for the search box that says Note: Watermark requires JavaScript.

Adsense search selection

Sure enough, with this code changed, it now validates.