WordPress.org

Ready to get started?Download WordPress

Forums

Mystique - Year included in "posted date" on blog entries (12 posts)

  1. oldis
    Member
    Posted 3 years ago #

    In this forum thread:
    http://wordpress.org/support/topic/add-year-to-date-in-post
    I found a way to add year to the posted-date shown on each blog post. (as I have implemented on http://misty.gsj.no ).
    This fix involved modifications to the core.php file.
    It does work, but I guess it will disappear on upgrade of Mystique to a newer version. So I wonder if there is a more sustainable way of doing this, by keeping the modification in "User CSS" or possibly "User Functions" areas and not mess with core wordpress or theme files?

    The modification to core.php was:
    changed:

    <p class="day"><?php the_time('M jS') ?></p>
    to:

    <p class="day"><?php the_time('jS M Y') ?></p>

    Any better suggestion would be appreciated..

  2. Sennza Pty Ltd
    Member
    Posted 3 years ago #

    Hey there,

    The easiest way I can think of is to log in to your WordPress Dashboard then go to Settings->General Settings then change the Date Format to a custom one with the value of jS M Y.

    Hope that helps!

  3. oldis
    Member
    Posted 3 years ago #

    Bronson Quick:
    Thanks for your response!

    No, unfortunately that doesn't do the trick.
    As you can see from the above code sample from core.php, they override the setting I have configured in your general settings. I don't really know why thay haven't either using that value, or have their own theme preference that can be set.

    Anyone else?

    PS: Let me add that I am generally really, really impressed with the Mystique theme, and the work thats been put into it by DigitalNature.
    This is the only modification I have had to do in core files.
    Everything else has been done in their "User CSS" theme preference.

  4. oldis
    Member
    Posted 3 years ago #

    Let me add that I now have changed the date format mask to include even the day, using
    <p class="day"><?php the_time('l j. M Y') ?></p>

    It might be helpful to see the whole context of this, so this is the complete PHP-block its found in:

    <?php if($post_settings['post_info'] && !get_post_meta($post->ID, 'asides', true)): ?>
         <div class="post-date">
           <p class="day"><?php the_time(__('l j. M Y','mystique')); ?></p>
         </div>

    Jens

  5. Sennza Pty Ltd
    Member
    Posted 3 years ago #

    Ahh okay then. I'm with you now. I haven't got that theme I was just having a crack based on other themes. That's really kinda bad coding on their part because the user should have the option to customised it.

    What I'd personally do it change:
    <p class="day"><?php the_time('M jS') ?></p>

    to:
    <p class="day"><?php get_the_date(); ?></p>

    That value will grab the date and format it to whatever is in the setting that I mentioned above. I'd also send an email to the Mystique Theme guys and get them to alter the core files in the theme to have that so users can control the date format :)

    Hope that helps.

  6. Sennza Pty Ltd
    Member
    Posted 3 years ago #

    Eeeek, make that:

    <p class="day"><?php echo get_the_date(); ?></p>

    I forgot the echo! :)

  7. oldis
    Member
    Posted 3 years ago #

    Thanks, thats a good idea. Not that it matters much in this case, the postinstall/postupgrade edit is still there. I will see if I can find the contact details and send them an enhancement request.

  8. Sennza Pty Ltd
    Member
    Posted 3 years ago #

    Excellent.

    It's always good to get feedback as a theme author cause a lot of the time we don't test things like that so when users give us feedback on little things like that we'll change our themes to give the users more options going forward!

  9. oldis
    Member
    Posted 3 years ago #

    Oh, by the way:
    My blog is mostly in Norwegian. Do you know how I can localize the output of these date functions? So that I get the Day and Month in Norwegian spelling?

    Current (US English):
    Tuesday 7. December 2010

    Wanted (Norwegian):
    Tirsdag 7. Desember 2010

    Either hardcoded, or based on browser locale.
    Thanks...

    PS: Let me admit that I have done absolutely nothing to find out, not even a google search. It was just something that struck me right now. If you want me to do my own homework,thats fine...
    ;-)

  10. Sennza Pty Ltd
    Member
    Posted 3 years ago #

    To set the language in WordPress you normally have to add a line into the wp-config.php file in the root directory.

    define ('WPLANG', 'nb_NO');
    or
    define ('WPLANG', 'nn_NO'); should work for you.

    Norwegian (norsk)

  11. oldis
    Member
    Posted 3 years ago #

    Thanks a lot for your help!
    I will checkout the link you supplied, and read up on localisation. Not something i just want to jump into, as it may have undesired side-effects. I will play around a little on my testsite and se what I do.

    I leave this thread open for a little while and see if anyone else would like to chime in..
    Kudos!

  12. oldis
    Member
    Posted 3 years ago #

    Update:
    I couldn't find an email address to use for submitting such a request, so I just submitted it as a comment on their feedback/discussion for Mystique. I guess there a good chance it will just drown in between all the other 7000+ comments, but lets see.

    I don't want to point fingers, after all this is a free theme, and I can understand that with its popularity there would be a lot of support involved in having an open email.

    I guess the proof of this themes quality is the fact that this is the only quirk I have found... (+ having to copy the favicon.ico file manually to override the builtin...)

    So well done, DigitalNature! And thanks for sharing.

Topic Closed

This topic has been closed to new replies.

About this Topic