CMS Development

csbeck
Teilnehmer/-in

Publish Date not accurate on blog listing page

lösung

I've created a blog listing page for my client:

http://blog.j2interactive.com/

 

I've added the code to show the published date: <div class="post-date">{{ content.updated|datetimeformat('%B %e, %Y') }}</div>.

It's showing the correct format for the date, but it's not showing the correct published date. Please take a look at these screenshots that show the listing page and the Design view of blog posts.

ListingPage_ScreenShot_01.pngListingPage_ScreenShot_02.png

 

It would be great if someone would help determine how to fix this.

 

Thanks, Chris

 

0 Upvotes
1 Akzeptierte Lösung
csbeck
Lösung
Teilnehmer/-in

Publish Date not accurate on blog listing page

lösung

I found the error in my code. I was showing the "Content-Updated" date and not the "Published Date". Rookie mistake. This is the code that I am now using in my listing page which correctly shows the published date:

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

 

Hopefully this will help someone in the future.

 

Chris

Lösung in ursprünglichem Beitrag anzeigen

3 Antworten
csbeck
Lösung
Teilnehmer/-in

Publish Date not accurate on blog listing page

lösung

I found the error in my code. I was showing the "Content-Updated" date and not the "Published Date". Rookie mistake. This is the code that I am now using in my listing page which correctly shows the published date:

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

 

Hopefully this will help someone in the future.

 

Chris

tdunlavey
Teilnehmer/-in

Publish Date not accurate on blog listing page

lösung

Writing from the future—this helped me. Thank you.

csbeck
Teilnehmer/-in

Publish Date not accurate on blog listing page

lösung

I've had to remove that code from the listing page because the client doesn't want to see incorrect dates. Hopefully this information is enough to help troubleshoot this.

0 Upvotes