WordPress.org

Make WordPress Core

Opened 3 years ago

Last modified 3 years ago

#21110 closed defect (bug)

Post Dates in wp_get_recent_posts list — at Version 2

Reported by: oqm4 Owned by: oqm4
Milestone: Priority: normal
Severity: normal Version: 3.4
Component: General Keywords:
Focuses: Cc:

Description (last modified by SergeyBiryukov)

Using WP 3.3.2, the following statement worked perfectly:

<?php
$args = array( 'numberposts' => '3', 'post_status' => 'publish' );
$recent_posts = wp_get_recent_posts( $args );
foreach( $recent_posts as $recent ){
echo '<li id="date"><a href="' . get_permalink($recent["ID"]) . '" title="'.esc_attr($recent["post_title"]).'" >' .  get_the_date('M d') . '</a></li><li><a href="' . get_permalink($recent["ID"]) . '" title="'.esc_attr($recent["post_title"]).'" >' .   $recent["post_title"].'</a> - '.esc_attr($recent["post_excerpt"]).'</li><li id="breaker"></li>';
}
?>

However, since upgrading to 3.4 -- and subsequently to 3.4.1 -- the output contains the date on which the list appears vs. the individual post dates. For example,

  • Apr 13 - Post Title - Post Summary
  • Apr 13 - Post Title - Post Summary
  • Apr 13 - Post Title - Post Summary

vs.

  • Jun 13 - Post Title - Post Summary
  • May 10 - Post Title - Post Summary
  • Mar 01 - Post Title - Post Summary

Change History (2)

comment:1 @ocean903 years ago

  • Description modified (diff)

comment:2 @SergeyBiryukov3 years ago

  • Description modified (diff)
Note: See TracTickets for help on using tickets.