• Resolved chrislowthian

    (@chrislowthian)


    Hi,

    Just wondering how I would change the date order on the bottom of the posts (see screenshot)

    At the moment it is displayed as yyyy/mm/dd but as I am in the UK I really need it to be dd/mm/yyyy.

    I don’t mind getting my hands dirty editing a little HTML etc.

    I am guessing I would need to edit multiple templates including archives? or is this something which is controlled by the functions.php file?

    Thanks in Advance!

    Screenshot: https://www.dropbox.com/s/xhdpbnbnciyrrac/Screenshot%202014-07-19%2023.33.07.png

Viewing 3 replies - 1 through 3 (of 3 total)
  • Theme Author Anders Norén

    (@anlino)

    Hi Chris,

    Create a child theme for Baskerville by following the instructions on this page. Once that’s done, copy the following files from the Baskerville folder and paste them in the child theme folder:

    content.php
    content-video.php
    content-status.php
    content-quote.php
    content-link.php
    content-image.php
    content-gallery.php
    content-audio.php
    content-aside.php
    single.php

    Open one of the files in the child folder and search for the string <?php the_time( ‘Y/m/d’ ); ?>. Replace it with <?php the_time( ‘d/m/Y’ ); ?>. Repeat for each of the files listed above.

    It’s bit of a cumbersome process, but by making the changes in a child theme, they won’t revert when a new version of Baskerville is released. Let me know how it works out!

    – Anders

    Thread Starter chrislowthian

    (@chrislowthian)

    This worked great thanks.

    Just a bit of feedback. If you check the single.php file you actually have:

    <?php the_time( get_option( 'date_format' ) ); ?>

    In all the content files you have:

    <?php the_time( 'Y/m/d' ); ?>

    Would it not be better to change all the content files to use:

    <?php the_time( get_option( 'date_format' ) ); ?>

    Then all users can control the date format from the WordPress Admin.

    Theme Author Anders Norén

    (@anlino)

    No worries!

    The reason for why Baskerville doesn’t use the date format set in user options is that the post meta will break at certain sizes if the date is too long. The Y/m/d works because it short, but for instance F j, Y (January 1, 2014) will break the design in some cases.

    It’s obviously not optimal to always use Y/m/d either, but it felt like the best compromise at the time.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Change Date Order on Posts’ is closed to new replies.