Support » Fixing WordPress » datetime="%3$s" in raw text

  • Hello!
    I’m using a Twenty Ten child theme. I created a custom template and everything works properly except for the time of the posts.
    To display the time/date I use:
    <?php twentyten_posted_on(); ?>

    And the date is displayed, the problem is that looking at the code I have:
    <span class="sep">Published on</span> <time class="entry-date" datetime="%3$s" pubdate>20th december 2011</time> </div>

    Why there is datetime=”%3$s” in raw text? For some strange reason it doesn’t get converted…

    Can you help me?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Michael


    look into functions.php of the theme; there might be an error in the code of the ‘twentyten_posted_on’ function.

    compare with a fresh download.

    what happens if you deactivate all plugins?

    Ouch! You’re right.
    I have this code (for overriding “Posted on” text and have it translated in italian):

    // function to override default posted on
    function twentyten_posted_on() {
    	$link= esc_url( get_permalink() );
    	$title= esc_attr( get_the_title() );
    	$time= esc_attr( get_the_time() );
    	$dateGMT= esc_attr( get_the_date( 'c' ) );
    	$date= esc_html( get_the_date() );
    	$authorURL= esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) );
    	$author= esc_html( get_the_author() );
    	echo ('<span class="sep">Pubblicato il</span> <time class="entry-date" datetime="%3$s" pubdate>'.$date.'</time>');

    I just removed the datetime parameter and the problem is solved.

    Do you know another way to have the posted on text translated in italian instead of “hacking” the function?

    If I remove the function the text doesn’t get translated.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘datetime="%3$s" in raw text’ is closed to new replies.