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

0
1 Star2 Stars3 Stars4 Stars5 Stars(快来投票)
Loading...

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

< ?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 “• 

有不同想法?说说看