Forums

[resolved] Replace date and time at end of posts (5 posts)

  1. chaski
    Member
    Posted 2 years ago #

    We would like to modify the date time showing at end of posts from something like this:
    Posted on February 3, 2010 at 3:58 pm.

    to something like this:
    Posted on February 3, 2010.

    Any help would be appreciated. I am assuming it will involve changing this line in category.php, but have not had any luck.

    <div class="entry-date">Date Published: <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. MichaelH
    Volunteer
    Posted 2 years ago #

    That code shows "Date Published:" so that's not the code that does the "Posted on" thing.

    Look further for the_time or the_date in your theme's template files. Use http://wingrep.com if necessary.

    Review the template tag, the_time(), and see Formatting_Date_and_Time for various formats that can be used to display the date and time.

    Related:
    Stepping Into Template Tags
    Stepping Into Templates
    Template Hierarchy

  3. chaski
    Member
    Posted 2 years ago #

    My apologies, I should have put "Date Published" That is the correct block of code.

  4. MichaelH
    Volunteer
    Posted 2 years ago #

    You probably could just change get_the_time() to '' <--that's two apostrophes

  5. chaski
    Member
    Posted 2 years ago #

    Thank you, that resolves the problem.

Topic Closed

This topic has been closed to new replies.

About this Topic