2006.03.10 by scavin

题外话:wordpress的最新文章代码

0

加到合适的位置就可以了,本来应该放到主站的,可那里有点问题放不了代码~~比较郁闷~~~

< ?php
$today = current_time('mysql', 1);
if ( $recentposts = $wpdb->get_results(“SELECT ID, post_title FROM $wpdb->posts WHERE post_status = ‘publish’ AND post_date_gmt < '$today' ORDER BY post_date DESC LIMIT 10")):
?>

< ?php _e("Recent Posts"); ?>
< ?php
foreach ($recentposts as $post) {
if ($post->post_title == ”)
$post->post_title = sprintf(__(‘Post #%s’), $post->ID);
echo “•