定制wordpress左边的sidebar

我的18ie.com 采用wordpress作为blog, 左边是一个长长的sidebar。如果右边的正文很长,左边的sidebar就显得很空,比较难看,也浪费屏幕的空间。

于是,我修改了wordpress/wp-content/themes/你的风格/sidebar.php,找个合适的地方,加入以下语句:

$news=$wpdb->get_results("SELECT ID,post_title FROM $wpdb->posts
WHERE post_status = \"publish\" ORDER BY ID DESC LIMIT ".$how_many);
foreach($news as $np){printf ("%s",$np->post_title);

效果,看本站 www.18ie.com/wordpress  的左侧。

www.18ie.com 欢迎留言

飞涛软件工作室
2006-10-07 15:09:24

全部文章