[resolved] remove time stamp only, keep date (5 posts)

  1. Trailmix
    Posted 4 years ago #

    I want to remove just the time stamp and leave the date. I checked the codex but mine looks more complicated and I'm getting errors with everything I've tried. So what parts do I need to delete from this code?
    <div class="entry-date"><abbr class="published" title="<?php the_time('Y-m-d\TH:i:sO') ?>"><?php unset($previousday); printf( __( '%1$s – %2$s', 'sandbox' ), the_date( '', '', '', false ), get_the_time() ) ?></abbr></div>

  2. channeleaton
    Posted 4 years ago #

    That's a weird use of the <abbr> tag. Anywho...

    Remove the following 2 items:



    the_date('', '', '', false),

  3. Trailmix
    Posted 4 years ago #

    I get an error:

    Warning: printf() [function.printf]: Too few arguments in [my url] on line 19

    But it seems like that suggestion would remove the date and I'm trying to keep the date and remove the time only. Anyway I decided to just copy the simple code from the codex:

    <div class="entry-date"><?php the_time('l, F jS, Y') ?></div>

    And it works! Although I don't really know what the rest of the code was that I deleted... do you see anything I should have left in there?

  4. Michael
    Forum Moderator
    Posted 4 years ago #


    <div class="entry-date"><?php unset($previousday); printf( __( '%1$s', 'sandbox' ), the_date( '', '', '', false )) ?></div>


  5. Trailmix
    Posted 4 years ago #

    Thanks alchymyth - that's just what I needed. Works great.

Topic Closed

This topic has been closed to new replies.

About this Topic