博客是记录点滴的地方,也许是随笔,也许是深思。
缘起新浪博客,人气旺、收录快,但有时科技型博文被无缘故屏蔽以及模板等问题,转入网易LOFTER;LOFTER和网易云音乐、163邮箱等一同是网易公司的精品,模板优秀,但可调节的选项太少,某些模板的字体颜色、大小、页面宽度等无法修改,转入GitCafe静态博客;GitCafe国内访问速度很快,静态博客可用Pelican或Hexo生成,Hexo简单快速,且Hexo下的next响应式主题很赞,但静态博客每次都要重新生成,繁琐,转入独立域名+独立空间+WordPress。
域名选择阿里万网下的com域名,国内备案被告知网站名称不能为英文,而misaraty用了很多年,所以倾向香港空间;对比景安国内、锐壳香港、恒创香港,恒创香港空间不错,目前在用,稳定,但国内访问速度一般。考虑到访问速度,网站由恒创迁入景安。
独立空间建站工具的有WordPress、Z-Blog、emlog、Typecho、WeCenter,WordPress是世界广泛使用的建站工具,安全、稳定;Z-Blog、emlog、Typecho是国内轻量工具,Z-Blog的文本编辑器优秀,Typecho的默认模板简约,emlog响应速度快;WeCenter是类似知乎的响应式论坛。根据个人需求和网站稳定性、安全性考量,选择了WordPress。
论坛,FluxBB不错。其他phpBB、SMF等也不错,占有率很高。
WordPress主题中,在Kumle、Dynamic News Lite、Twenty Fifteen、First、write、Wellington、zeeDynamic、Lingonberry、MH Magazine lite,主题中选择Twenty Fifteen。同时对网站做如下调整:
MH Magazine lite隐藏特色图像
自定义-额外CSS,
.mh-image-placeholder { display: none; }
更改默认字体为微软雅黑,打开style.css
~/wp-content/themes/twentyfifteen/css/editor-style.css
~/wp-content/themes/twentyfifteen/style.css
~/wp-includes/js/tinymce/skins/wordpress/wp-content.css
~/WEB/wp-content/plugins/simple-code-highlighter/estilo.css
font-family: Arial, "Microsoft YaHei", "Droid Sans Fallback", "Hiragino Sans GB", Simsun, sans-serif;
修改站点页脚,footer.php。
安装插件:代码高亮Crayon Syntax Highlighter、Simple Code Highlighter、Enlighter-Customizable Syntax Highlighter、登录保护Login LockDown、Easy Updates Manager(管理wordpress/theme/插件更新)、TinyMCE Advanced(可以打出上标下标)、WP Acceleration for China(Gravatar头像加速)、验证码Math Captcha(汉化包)、WPBruiser {no- Captcha anti-Spam}、WP Downgrade(版本降级到4.9.9)、XML Sitemap & Google News、WP Fastest Cache等。
添加ICO,打开header.php,在<head>…</head>之间填入,
<link id="favicon" href="https://www.misaraty.com/a.ico" rel="icon" type="image/x-icon" />
修改摘要字数限制
打开~/wp-includes/formatting.php,
$excerpt_length = apply_filters( 'excerpt_length', 100 );
禁用英文引号自动转中文引号
~/wp-includes/formatting.php,
注释下面代码,
$curl = str_replace( $static_characters, $static_replacements, $curl ); if ( false !== strpos( $curl, "'" ) ) { $curl = preg_replace( $dynamic_characters['apos'], $dynamic_replacements['apos'], $curl ); $curl = wptexturize_primes( $curl, "'", $prime, $open_sq_flag, $closing_single_quote ); $curl = str_replace( $apos_flag, $apos, $curl ); $curl = str_replace( $open_sq_flag, $opening_single_quote, $curl ); } if ( false !== strpos( $curl, '"' ) ) { $curl = preg_replace( $dynamic_characters['quote'], $dynamic_replacements['quote'], $curl ); $curl = wptexturize_primes( $curl, '"', $double_prime, $open_q_flag, $closing_quote ); $curl = str_replace( $open_q_flag, $opening_quote, $curl ); } if ( false !== strpos( $curl, '-' ) ) { $curl = preg_replace( $dynamic_characters['dash'], $dynamic_replacements['dash'], $curl ); }
Twenty Fifteen主题文章显示为摘要模式
打开~/wp-content/themes/twentyfifteen/index.php,
get_template_part( 'content-search', get_post_format() );
禁用更新
打开~/wp-config.php,增加,
define( 'WP_AUTO_UPDATE_CORE', false );
打开~/wp-content/themes/twentyfifteen/functions.php,增加,
add_filter('pre_site_transient_update_core', create_function('$a', "return null;")); // 关闭核心提示 add_filter('pre_site_transient_update_plugins', create_function('$a', "return null;")); // 关闭插件提示 add_filter('pre_site_transient_update_themes', create_function('$a', "return null;")); // 关闭主题提示 remove_action('admin_init', '_maybe_update_core'); // 禁止 WordPress 检查更新 remove_action('admin_init', '_maybe_update_plugins'); // 禁止 WordPress 更新插件 remove_action('admin_init', '_maybe_update_themes'); // 禁止 WordPress 更新主题
增加备案号
打开~/wp-content/themes/kumle/footer.php,
<?php /** * The template for displaying the footer * * Contains the closing of the "site-content" div and all content after. * * @package WordPress * @subpackage Twenty_Fifteen * @since Twenty Fifteen 1.0 */ ?> </div><!-- .site-content --> <footer id="colophon" class="site-footer" role="contentinfo"> <div class="site-info"> <center><a href="http://www.miitbeian.gov.cn" target='_blank' >京ICP备18056516号</a><center> </div><!-- .site-info --> </div><!-- .site --> <?php wp_footer(); ?> </body> </html>