【发布时间】:2013-08-11 18:52:37
【问题描述】:
我有一个侧边栏,我想在其中显示最近的帖子。现在它显示标题、日期和摘录。日期显示我想摆脱的时间。我用这个来显示日期:$recent["post_date"]
<?php
$args = array( 'numberposts' => '3' );
$recent_posts = wp_get_recent_posts( $args );
foreach( $recent_posts as $recent ){
echo '<li id="sidebar_text"><b>'.$recent["post_title"].'</b></li><li style="font-size:12px">'.$recent["post_date"].'</li><li><i style="font-size:15px">'.$recent["post_excerpt"].'</i><a href="'.get_permalink($recent["ID"]).'"> Read More</a></li>';
}
?>
它显示的日期是这样的:2013-08-11 18:29:04,我想要这样的 8-11-2013 并且没有时间。提前致谢。
【问题讨论】: