• Hello,

    My archives page isn’t correctly displaying the post date —?instead, it’s grabbing yesterday’s date for all the posts. The 19th of July. Although, yesterday, it was also showing the 19th, so I’m not sure what’s going on. I’m sure I’m overlooking something really stupid…

    <a href="<?php echo get_permalink( $archive_post->ID ); ?>"><?php echo get_the_title( $archive_post->ID );?> <span>(<?php echo get_the_date( get_option('date_format') ); ?>)</span></a> &rarr; <span class="archive-sub"><?php get_the_subtitle( $archive_post->ID ); ?></span>

    Appreciate any help.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • i have same problem

    https://aadharcardstatusin.com

    Moderator bcworkz

    (@bcworkz)

    Using echo get_the_date( get_option('date_format') ); on my site, I get the post date as expected, so it’s not a problem with your code. The returned date string is filterable, so it’s likely there is other code inappropriately altering the date returned.

    Please install and activate the health-check plugin. (Yes, it has many bad reviews. This is because many people do not understand how it works and wrongly believe it broke their site.) Enter troubleshooting mode. This will switch your site to the twentyseventeen theme and deactivate all plugins. For your view only, other visitors see the normal site.

    Twentyseventeen’s archive template post date is more convoluted than your code, but it boils down to echo get_the_date( get_option('date_format') ); just like your code. You should see the correct dates however. You can selectively reactivate your theme and plugins to help find out what module is altering the dates.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Problem with showing post date in archives’ is closed to new replies.