Support Forums for LiveMesh Themes & Plugins › Forums › Extinct Theme Support › Date format for blog posts
Tagged: date blog
- This topic has 6 replies, 2 voices, and was last updated 5 years ago by
Raghavendra.
-
AuthorPosts
-
September 30, 2020 at 3:53 pm #35820
polf0001
ParticipantHello, I want to change the date on blog posts so it includes the year as well as the month and day. I asked this question in 2016 and got an answer, but it no longer works with the revised theme. Can you tell me where to change the php, please? The 2016 question is here:
https://support.livemeshthemes.com/forums/topic/date-format-for-blog-posts/
Thanks!
October 2, 2020 at 12:41 pm #35821Raghavendra
ModeratorCan you pls have this file of the parent theme in your child theme and modify the same to your needs?
templates/meta/published.php
October 3, 2020 at 7:29 pm #35824polf0001
ParticipantThanks, Raghanendra. OK: I have had a look at this php. Here it is. Can you tell me what to edit, please? I just want it to add the year to the month and the day.
<?php
$format = “M d, Y”;
?>
<span class=”published”>
<?php echo __(‘On: ‘, ‘extinct’); ?>
</span>
October 3, 2020 at 7:33 pm #35825polf0001
ParticipantScreenshot attached to give line numbers.
[attachment file=”35826″]
October 9, 2020 at 1:03 pm #35829Raghavendra
ModeratorI hope this is resolved as I saw the year in the PHP. If not, please reach out to us and we will help.
October 9, 2020 at 3:35 pm #35830polf0001
ParticipantThanks. Sorry, I’m afraid it’s not resolved! That’s the php file as it now is, unedited, and the year doesn’t appear.
Here’s the site: https://www.paper-darts.com/news/
It’s the little red tab on the blog items – it says SEP 30 – where it should be SEP 30 2020.
best wishes,
Nick
October 21, 2020 at 1:39 pm #35845Raghavendra
ModeratorYou need to create a new file named published-custom.php in templates/meta/ folder and have the following content in the same to make the year appear in the desired place –
<?php ?> <span class="published"> <abbr title="<?php echo sprintf(get_the_time(esc_attr__('l, F, Y, g:i a', 'extinct'))); ?>"> <span class="month"><?php echo sprintf(get_the_time('M')); ?></span> <span class="date updated"><?php echo sprintf(get_the_time('d, Y')); ?></span> </abbr> </span> -
AuthorPosts
- The forum ‘Extinct Theme Support’ is closed to new topics and replies.