ThemeShaper Forums » Thematic

[closed]

Revision 347 - Modify time / date format in post meta

(7 posts)
  • Started 5 years ago by Chris
  • Latest reply from Andrew
  • This topic is not a support question
  1. I integrated two filters to format the time/date in post meta:
    - thematic_time_title() <- url title
    - thematic_time_display() <- displayed time

    Now you can easily change the format in your functions.php using:

    function my_time_display($time_display) {
      return 'm. F Y';
    }
    add_filter('thematic_time_display','my_time_display');

    For details on time/date formats see table of date format characters on the PHP website.

    Cheers,

    Chris

    Posted 5 years ago #
  2. i wonder why Thematic dont get the standard Wordpress Option to display the Date and Time. Whats the reason?

    Posted 5 years ago #
  3. .. good idea .. let me see what I can do .. anyway, it'll stay configurable using a filter just in case that the designer or the user wants to change it.

    Cheers,

    Chris

    Posted 5 years ago #
  4. It has to do with getting a microformatted date. But it could probably be better.

    Posted 5 years ago #
  5. Handy Filter Chris! Thanks.
    One question though. How might it be possible I could wrap some div's around the Time/date output. For styling purposes. I want to have the month/day/year all be stacked vertically and I need to apply some <span></span> or classes.

    I've tried applying some class in the
    return 'M d Y';

    But they create some whacky output as I don't think I'm allowed to add any html in here.

    Any tips?

    Posted 3 years ago #
  6. middlesister
    Member

    I'm think you need to override or filter the whole of postmeta_entrydate and call get_the_time('M'), get_the_time('d') and get_the_time('Y') separately within the spans you need.

    Posted 3 years ago #
  7. Ah, That sounds just about perfect. Thanks Middlesister!

    Posted 3 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.