Currently when a node or comment is submitted it gets a Submitted text saying "Submitted by user on Wed, 04/01/2015 - 18:07"
The mark-up for this is:
<span>Submitted by *user* on <time pubdate="pubdate" datetime="2015-04-01T18:07:34+0000">Wed, 04/01/2015 - 18:07</time></span>
What I need to do is remove the "pubdate" attribute from the tag because the it is failing on W3C validation.
I have tried to add the following code in my template.php file but had no luck
function ThemeName_preprocess_node(&$variables) {
$attributes['datetime'] = '<time'.drupal_attributes($attributes) .'>'.$variables['date'] . '</time>';
}
How can I remove the "pubdate" attribute in the Submitted by tag?
ThemeName_preprocess_node
you need to set some value into$variables
otherwise no changes will make it to your template. It's most likely theme dependent what variable you need to set, but you possibly want to override the current value of$variables['date']
. Can you post the relevant part of your theme's node.tpl.php?