题外话:wordpress的最新文章代码
加到合适的位置就可以了,本来应该放到主站的,可那里有点问题放不了代码~~比较郁闷~~~
< ?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 “• ID).”‘>”;
the_title();
echo ‘
‘;
}
?>
$post->post_title = sprintf(__(‘Post #%s’), $post->ID);
echo “• ID).”‘>”;
the_title();
echo ‘
‘;
}
?>
< ?php endif; ?>
链接如若失效请反馈;网络整理资源若侵权留言处理!