Forums

"The Date" Tag (4 posts)

  1. ian2
    Member
    Posted 6 years ago #

    Hi this is what I want it to look like:

    By <Author Name> on <Date> at <Time>

    I put this in:

    By <?php the_author() ?> on <?php the_date(); ?> at <?php echo get_the_time(); ?>

    But all I get is:

    By Ian on at 11:22pm

    (no date)

    What am I doing wrong? Thanks.

  2. Joshua Sigar
    Member
    Posted 6 years ago #

    By default, the_date() output is formatted according to "Options -> General -> Default Date Format."

    You could change the default format, or you could customize it by passing parameter to the_date() http://codex.wordpress.org/Template_Tags/the_date

  3. jonimueller
    Member
    Posted 6 years ago #

    Your date must be formatted like this:

    <?php the_time("m/d/Y (g:i a)") ?>

    to get this:

    July 26, 2005 (10:47 pm)

    Hope this helps.

  4. ian2
    Member
    Posted 6 years ago #

    Thanks to both of you!

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.