CMS Development

csbeck
参加者

Publish Date not accurate on blog listing page

解決

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 いいね!
1件の承認済みベストアンサー
csbeck
解決策
参加者

Publish Date not accurate on blog listing page

解決

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

元の投稿で解決策を見る

3件の返信
csbeck
解決策
参加者

Publish Date not accurate on blog listing page

解決

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
参加者

Publish Date not accurate on blog listing page

解決

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

csbeck
参加者

Publish Date not accurate on blog listing page

解決

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 いいね!