ThemeShaper Forums » Thematic

[closed]

Changing format of post date

(24 posts)
  • Started 5 years ago by heather
  • Latest reply from uranbold
  • This topic is resolved

Tags:

  1. heather
    Member

    does anyone know what php file i do this in?
    thanks

    Posted 5 years ago #
  2. What do you want to change exactly?

    Posted 5 years ago #
  3. heather
    Member

    I want to put the date to the left of the entry-title. And stylize the look of the date so that the day of the month is enlarged relative to the short textual representation of a month.

    Kind of like below:

    NOV
    28
    2008

    Wordpress says that such changes can be made in date.php, but this is no where to be found. I have never worked with wordpress, so I'm not that familiar with it.

    Posted 5 years ago #
  4. To start, I'd read Custom WordPress Hooks and Filters in Thematic 0.6.

    You'll need to change this in the functions.php of your child theme, providing new content for thematic_postheader(). It may seem like a little more work but since I update Thematic every couple weeks—making it better, of course—it makes your life easier by providing a clean upgrade.

    That said, your question has pointed out an area where I could make filtering Thematic even easier. It'd be nice if you could do this:

    function child_postheader() {
      $postdate = 'something different';
    }

    Right now you can't do that, but you should be able to. So, thanks for making me think of that.

    Posted 5 years ago #
  5. But you could just copy-paste my sample post header from Custom WordPress Hooks and Filters in Thematic 0.6 and make your changes there. It's pretty straightforward. Although I'm using the_time('F jS, Y') instead of the_date().

    Posted 5 years ago #
  6. Let me know how it works out.

    Posted 5 years ago #
  7. heather
    Member

    Thanks, I will.

    Posted 5 years ago #
  8. Ian, do you think an option in the options-panel to format the date was possible? I mean, currently it is: "month day year" and i would like to keep everything as it is, but change that into "day. month year".

    Applying a hook would be the wrong way, since this is - in my eyes - something in between content and semantics...

    Posted 5 years ago #
  9. You're probably right. I'll look into it.

    Posted 5 years ago #
  10. Thanks

    Posted 5 years ago #
  11. I wanted to do the same thing as Heather. For now, I've just edited Thematic's hooks-filters.php as follows:

    //   $postmeta .= get_the_time('F j, Y');  	/* Commented out this line */
    $postmeta .= '<span class="entry-month">';      /* Added the following */
    $postmeta .= get_the_time('M');
    $postmeta .= '</span><span class="entry-day">';
    $postmeta .= get_the_time('j');
    $postmeta .= '</span><span class="entry-year">';
    $postmeta .= get_the_time('Y');
    $postmeta .= '</span></abbr></span>';	   /* added leading closed span */

    But I would much prefer to do this through filters.php as Ian suggests; just haven't had time to figure out how yet. If I do it I will post my code. (If someone else does, maybe you will share the wealth?)

    Posted 5 years ago #
  12. Has anyone made any progress on date formatting?

    I'm using a Child theme and would rather not edit hooks-filters.php to simplify upgrades. Although I'm familar with the concept of hooks, I've never really understood how to use them due to my (very) limited PHP.

    I'm all for simplicity Ian but surely one more item on the options panel would be OK?

    Posted 5 years ago #
  13. I'd love to know if anyone has clue how to do this properly. I've been fidling around with it, but not to my content..

    Posted 4 years ago #
  14. Hi,

    you could filter thematic_postheader_postmeta() ..

    or I could make the whole thing even more flexible ;)

    Could you please give me some more details?

    Chris

    Posted 4 years ago #
  15. I am looking for the most solid solution to implement a day/month/year on the side solution such as can be found here: http://thebuckmaker.com/aerotronic-preview/?wptheme=aerotronic-default

    My preference would be to not alter the function thematic_index_loop() too much, but can't seem to figure out the best way.. yet :-)

    Posted 4 years ago #
  16. Amy
    Member

    I'm trying to figure this out too!

    Posted 4 years ago #
  17. Hi,

    .. ok .. you convinced me :)

    Here's my plan for the next couple of days:

    I already split thematic_postheader() into thematic_postheader_posttitle() and thematic_postheader_postmeta() while keeping the known filters.

    I'm going to split thematic_postheader_postmeta() into the several parts like author, entry-date, and so on (including the separators). Every part has its own filter and everything can be rearranged to meet your needs by using the new functions without rewriting the whole code.

    Think that this should make the whole thing as flexible as possible.

    Chris

    Posted 4 years ago #
  18. That sound like a plan :) I'm guessing these changes will appear in the next future version of thematic?

    Posted 4 years ago #
  19. Yes .. these changes will be in the next release. Think that we're going to release a public beta in the next couple of days.

    Chris

    Posted 4 years ago #
  20. Cool! looking forward to it. Will we find out via Ian's RSS feed or otherwise?

    Posted 4 years ago #
  21. .. will be announced everywhere .. on Ian's blog, here and via Twitter :)

    Posted 4 years ago #
  22. Amy
    Member

    Awesome!

    Posted 4 years ago #
  23. JC
    Member

    Hi !
    Thank you Ian and Chris , I'am enjoying using Thematic, and it makes me use my brains ;-)

    I'am trying to style the date just like Heather (from this thread's beginning)
    So now that thematic_postmeta_entrydate() has been implemented I'am trying to style by applying a filter but with no success so far (sorry I'm not very good at coding)
    This is what I tryied so far :

    // Add a custom post meta entry date

    function my_postheader_date() {

    global $post; ?>

    <span class="entry-date">
    <span class="month"><?php the_time('M') ?></span>
    <span class="day"><?php the_time('d') ?></span>
    </span>

    <?php add_filter('thematic_postmeta_entrydate','my_postheader_date');

    } ?>

    but no luck :(
    Someone please could take a look and direct me to the solution ?

    Thanks a lot !

    Posted 4 years ago #
  24. uranbold
    Member

    What about The A Day go, 1 minute ago, 5 sec ago Like Facebook and like Mashable.com.

    Posted 2 years ago #

RSS feed for this topic

Topic Closed

This topic has been closed to new replies.