I think you’ll find it’s in multiple templates files in the default theme. Just go through each one searching for role="some_text" and remove just that phrase.
Hi Thanks to both of you.
I’m using a custom theme so default should’t shouldn’t be affecting it.
So it doesn’t actually say the words aria’required?
I’ve checked in comments.php but couldnt find it.
Will try looking for role=”…”
Actually I take it back. I mis-read your post and I think xdesi is probably right. However a link to the page you’re trying to validate would help to confirm it.
It will say the words aria-required, esmi was also stating that most themes also make use of the “role” attribute which is also another attribute in addition to aria-required, common in the default and some custom themes, which the validator reports as an error..
If you are using an editor you can just make use of it’s search function and search in all files in your theme folder for the words aria-requied.
In comments.php look out for something like:
<?php if ($req) echo "aria-required='true'"; ?>
Here’s a page with the problem:
http://a11.johnburrell.co.uk/?p=1
I don’t have a comments.php in my custom theme, will wp use the default one?
Cheers,
John
Yeah I think it’s using the one from the default theme by the looks of it, so find that line I posted above in wp-content/themes/default/comments.php, remove it and see!
Yes it does, just checked it out:
From:http://codex.wordpress.org/Theme_Development
comments.php
The comments template. If not present, comments.php from the “default” Theme is used.
Found it – default theme/comments.php as xdesi predicted. So just change:
<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'"; ?> />
to
<p><input type="text" name="author" id="author" value="<?php echo esc_attr($comment_author); ?>" size="22" tabindex="1" />
Great!
I removed the two lines of php for the aria-required in the default comments.php and the page validated.
Thanks to you both for your help. I’d buy you both a pint if it was possible.
Cheers,
John
i had the same problem … i then deleted the two pieces of code in my theme’s comments.php file … now it passes w3c validation … thanks.
– swanie
In the theme that I am using, there is seemingly one line in the comments form
<?php
$args = array(
'comment_notes_after' => '',
'comment_field' => '<p class="comment-form-comment"><textarea id="comment" name="comment" cols="45" rows="8" aria-required="true"></textarea></p>'
);
comment_form($args); ?>
This gives two errors relating to aria. However, if I remove this instance of aria, yet the validator detects one aria error.
I am really unable to find the second instance. http://indiapoint.net/archives/
This error comes up in any individual post page
if anyone can help…
thanks