Support » Themes and Templates » Using the_time with user-preferred date formatting?

Using the_time with user-preferred date formatting?

  • I’m developing a new theme, and came across the phenomenon where the the_date template tag does not display the date more than once (mental note: add to Ideas after I post this).

    The alternative listed everywhere is to use the_time, but that requires me to decide on a single date formatting string for all users. With an earlier theme I did, people kept bugging me to change this so they could have the date displayed according to their country’s conventions.

    Is there any way to ‘get to’ the date formatting setting under ‘Settings->General’ and feed the format string to the_time?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Errr… huh?

    If you just use the_time() then it defaults to whatever the date formatting string in Settings->General is. Just like the_date() does.

    As far as I know, it’ll use the formatting string under “Time format” (not “Date format”), and will display the time, not the date.

    The thing is that lots of themes show the date for every post, not as a divider between days. This is how I’d like my theme to work as well. The only way to do this is to use the_time with a hard-coded format string. For international users, this is less than ideal.

    Ahhh, yes, I see. You want to use the date format string with the_time. Okay then. Use this:

    Thanks Otto 🙂 Several entire continents will be pleased 🙂

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Using the_time with user-preferred date formatting?’ is closed to new replies.
Skip to toolbar