• Resolved chrispopp8

    (@chrispopp8)


    I know I can change the information displayed for date and time in template-tags.php for single posts. But I would like to change how that information is formatted.

    esc_html( get_the_date(j M.Y))

    works just fine and looks like 26 Nov 2014 – all on one line.

    But if I want to make it be something akin to:

    26
    Nov 2014

    with 26 centered and larger than the month and year, I am not sure how to do that. Putting html in with the date codes does not work. Neither does using ‘ or / to prevent WordPress from interpreting the html as WordPress tags.

    ————-

    Changing this info for the loop where the post snippets are listed works just fine by editing the loop, so I know it’s possible.

Viewing 1 replies (of 1 total)
  • Thread Starter chrispopp8

    (@chrispopp8)

    NM.

    Wound up getting an answer on stackexchange.

    '<div align="center" style="display:block"><span id="da1">&nbsp;'. esc_html( get_the_date( 'j' ) ). '</span><br><span style="font-size:10px;display:block;">'.esc_html( get_the_date( 'M. Y' ) ) . '</span>')

Viewing 1 replies (of 1 total)
  • The topic ‘Formatting date and time display in single post’ is closed to new replies.