Hi -
I have the date on my blog post, but how do I get the date to show up under the title in a blog listing page?
Please advise asap.
Thank you!
Hi -
I have the date on my blog post, but how do I get the date to show up under the title in a blog listing page?
Please advise asap.
Thank you!
Hi @AFisher725
Thank you for reaching out
I want to tag some of our experts on this - @Alejandro_ @Gonzalo @MatthewShepherd do you have any thoughts to share with @AFisher725 on this?
Thank you!
Best
Tiphaine
Hi @AFisher725
This post will tell you how to edit your blog template. You need to edit your listing template. If that doesn’t help you find your listing template then navigate to settings (cog in top right) → website (in left sidebar) → blog ->templates (tab) and then look for ‘Template for listing pages’ and click the edit button beside this.
Once you are into your listing template in design manager look for the title of your post, it should look something like this, and note depending on your blog template this could appear multiple times in the template so add your date code beneath each instance:
<h2><a href="{{content.absolute_url}}">{{ content.name }}</a></h2>
Beneath this add code like one of the following, depending on what date format you want:
Full localised timestamp of post publish date and time
<div class="blog-post__timestamp">
{{ content.publish_date_localized }}
</div>
Custom date without time (you can move around day month year variables to reflect the format you need)
<div class="custom-date">
{{ content.publish_date_local_time.strftime('%d') }}
{{ content.publish_date_local_time.strftime('%B') }},
{{ content.publish_date_local_time.strftime('%Y') }}
</div>
Hope that helps!
Yes! After playing around to find the right location, it did work! Thank you so much.
for only date:
<div class=“content-date”>
{{ blogpost.publishDate|datetimeformat(‘%B %e, %Y’) }}
</div>