Blog, Website & Page Publishing

JLeach18
Participant

Show the "published date" rather than created on or updated date in in blog feed

SOLVE

Hello,

 

I am having issues with the blog feed showing the created or current date, instead of the published date (when using the blog post settings to back date a post). Can you please advise?

I tried the code below:

<div class="post-date">{{ content.publish_date|datetimeformat('%B %e, %Y') }}</div>

 

but it shows the actual created date, rather than the date I want to show (edited and back dated via the settings)

 

thanks

0 Upvotes
1 Accepted solution
alyssamwilie
Solution
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Show the "published date" rather than created on or updated date in in blog feed

SOLVE

@JLeach18 I need to see the entire code of the module to check that you're pulling the correct information. Cause since you mentioned all the posts are showing the same date I'm wondering if your code is actually grabbing the home page's date instead of the blog posts'.

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.

View solution in original post

6 Replies 6
alyssamwilie
Solution
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Show the "published date" rather than created on or updated date in in blog feed

SOLVE

@JLeach18 I need to see the entire code of the module to check that you're pulling the correct information. Cause since you mentioned all the posts are showing the same date I'm wondering if your code is actually grabbing the home page's date instead of the blog posts'.

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.
JLeach18
Participant

Show the "published date" rather than created on or updated date in in blog feed

SOLVE

Thanks, I eneded up removing the date altogether, unitl more blogposts will be published and so the dates will be relevant.

0 Upvotes
alyssamwilie
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Show the "published date" rather than created on or updated date in in blog feed

SOLVE

@JLeach18 As far as I'm aware publish_date should pull in whatever date is set in the blog's settings so your predicament is rather strange. Could you post your code? Is this being written on a blog_post or blog_listing  template?

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.
0 Upvotes
JLeach18
Participant

Show the "published date" rather than created on or updated date in in blog feed

SOLVE

Thanks for looking into it, it is a module to show the latest blog posts on the home page. Here is the code, I think what I need it to show is the timestamp rather than the published or created date (in red is what I have been updating and the date changes but never to the one I have as the publishing date option)

 

<span class="date-posted">
<span class="date-icon">
{% icon
name="{{ module.blog_item_style.icons.date_icon.name }}"
style="{{ module.blog_item_style.icons.date_icon.type }}"
unicode="{{ module.blog_item_style.icons.date_icon.unicode }}"
%}
</span>
{{ post.created|datetimeformat("%B %e, %Y") }}</span>

 

see screenshot to see which date I need showing: 

Screenshot 2022-10-17 at 16.40.26.png

0 Upvotes
JLeach18
Participant

Show the "published date" rather than created on or updated date in in blog feed

SOLVE

Thanks, but this doesn't work, it only shows the updated date from last week, in any case, all posts show the same date, instead of each showing a different date each that I want them to show (which you can edit in the individual post setting)

0 Upvotes
alyssamwilie
Recognized Expert | Elite Partner
Recognized Expert | Elite Partner

Show the "published date" rather than created on or updated date in in blog feed

SOLVE

@JLeach18 Try using content.updated instead of content.publish_date.

If this answer solved your question, please mark it as the solution.

Alyssa Wilie Profile Image

Alyssa Wilie

Web Developerat Lynton

Learn HubL | Get Marketing Insights

HubSpot Elite Solutions Partner
Lynton's HubSpot theme Rubric now available. Click to download.