WordPress.org

Ready to get started?Download WordPress

Forums

Date ordinal suffix superscript? (4 posts)

  1. masonchumpia
    Member
    Posted 9 years ago #

    Is it possible to get WordPress to print the ordinal suffix (e.g., st, nd, th) in superscript?

  2. Tahongawaka
    Member
    Posted 9 years ago #

    A quick glance at the php date function page (www.php.net/date) says that unrecognized characters to the date() function will return as listed. So, try l, F j<sup>S</sup>, Y

    You need to escape the s so it doesn't return the number of seconds. It returns this: Sunday, February 27<sup>th</sup>, 2005.

  3. Tahongawaka
    Member
    Posted 9 years ago #

    I liked the way it turned out so much that I made it a permanent part of my WordPress powered site. :)

  4. Tahongawaka
    Member
    Posted 9 years ago #

    Just came back to copy the code, it appears that the database removed the backslashes before the s in <\sup>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.