Blog is showing current date instead of published date.

SOLVE
AlixOfCanada
Member

Hi Everyone 🙂

I'm having this issue where when viewing blogs, the date reflects the current date and not the actual published date. I have another line of code temporarily in to preview, and it shows a completely wrong date.  While viewing a blog archive, everything is correct.

 

Any tips?

Thanks.

 

Design Manager view of template used for individual blogsDesign Manager view of template used for individual blogs

0 Upvotes
1 Accepted solution

Accepted Solutions
webdew
Solution
Top Contributor | Diamond Partner

Hi @AlixOfCanada ,

 Please use the below snippet to display actual published date
  <div class="blog-post__meta">
        <time datetime="{{ content.publish_date }}" class="blog-post__timestamp">
{{ content.publishDate|datetimeformat('%B %e, %Y') }}

        </time>
      </div>

Hope this helps!


If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regard.

View solution in original post

0 Upvotes
3 Replies 3
jonchim
Guide | Diamond Partner

Hey @AlixOfCanada, I believe on certain of the older templates, i've noticed that with blogs they used to have a default date that wasn't the publish date. But once it was published it would show the correct date on the frontend. Are you looking at a preview link of the post or the live link?






Jon Chim
Design Director
Morey Creative Studios


check Did my post help answer your query? Help the Community by marking it as a solution
0 Upvotes
AlixOfCanada
Member

Hey 🙂

Here's an example of what one of our posted blogs looks like. Note that this screenshot is outside the preview and the blog was actually posted on the 18th.

Screen Shot 2021-10-22 at 9.15.56 AM.png

0 Upvotes
webdew
Solution
Top Contributor | Diamond Partner

Hi @AlixOfCanada ,

 Please use the below snippet to display actual published date
  <div class="blog-post__meta">
        <time datetime="{{ content.publish_date }}" class="blog-post__timestamp">
{{ content.publishDate|datetimeformat('%B %e, %Y') }}

        </time>
      </div>

Hope this helps!


If we were able to answer your query, kindly help the community by marking it as a solution.

Thanks and Regard.

View solution in original post

0 Upvotes