[wp-trac] [WordPress Trac] #21110: Post Dates in wp_get_recent_posts list
WordPress Trac
wp-trac at lists.automattic.com
Fri Jun 29 08:20:24 UTC 2012
#21110: Post Dates in wp_get_recent_posts list
--------------------------------------+------------------------------
Reporter: oqm4 | Owner: oqm4
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: 3.4
Severity: normal | Resolution:
Keywords: dev-feedback needs-codex |
--------------------------------------+------------------------------
Description changed by SergeyBiryukov:
Old description:
> 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
New description:
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
--
--
Ticket URL: <http://core.trac.wordpress.org/ticket/21110#comment:2>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list