I’m attempting to integrate the timeago jQuery plugin with a custom wordpress theme build to display the time a post was published.
As the theme is built using HTML5, timeago requires the inserted code to look a little like this:
<time class="timeago" datetime="2008-07-17T09:24:17Z"></time>
Obviously, simply using <?php the_time() ?>doesn’t work, as the time has to be formatted as above.
Any help with this is greatly appreciated!
For those interested in what the solution to this turned out to be:
I actually dropped the plugin and added this to my functions.php file in WordPress,
}
That does the trick! Okay, it doesn’t update in real time but with each page refresh is good enough for me.