为wordpress添加coolcode插件的quicktag
修改 wp-includes/js/quicktags.js 文件
1. 找到
edButtons[edButtons.length] =
new edButton('ed_code'
,'code'
,'<code>'
,'</code>'
,'c'
);
在后面添加
edButtons[edButtons.length] =
new edButton('ed_coolcode'
,'coolcode'
,"
,'</coolcode>'
,'x'
);
2. 找到
else if (button.id == 'ed_link') {
document.write('<input type="button" id="' + button.id + '" accesskey="' + button.access + '" class="ed_button" onclick="edInsertLink(edCanvas, ' + i + ');" value="' + button.display + '" />');
}
在后面添加
else if (button.id == 'ed_coolcode') {
document.write('<input type="button" id="' [...]
WP-PageNavi 2.10 插件的BUG修正
这两天突然发现在搜索页和 tag 搜索页上的 pagenavi 不显示,
于是从网上搜到这个,我稍微修改了一下:
修改 pagenavi.php 内的 wp_pagenavi 函数
function wp_pagenavi($before=", $after=", $prelabel='«', $nxtlabel='»') { global $request, $posts_per_page, $wpdb, $paged; if (!is_single()) { if (get_query_var('post_type') == 'post') { preg_match('#FROM (.*)\s+(GROUP|ORDER) BY#', $request, $matches); $fromwhere = $matches[1];//var_dump($request); if(preg_match('#(.*)\s+(GROUP|ORDER) BY#',$fromwhere,$m2)) { $fromwhere = $m2[1]; } $numposts = $wpdb->get_var("SELECT COUNT(DISTINCT ID) FROM $fromwhere"); $max_page = ceil($numposts /$posts_per_page); } else { $max_page = 999999; } if(empty($paged)) { $paged = 1; } if($max_page > 1) { echo "$before 页数 [...]
博客世界最受欢迎的30个插件
From:
http://fairyfish.com/2007/04/02/top-30-wordpress-plugins-in-blogosphere/
翻译于:
http://www.staska.net/2007/03/27/top-30-wordpress-plugins-in-blogosphere/,
作者根据Lorelle的Lists of favorite Wordpress plugins上的48列表和280个插件,选出最受欢迎的30个插件。
Tags: blogosphere, plugins, wordpress
