Twenty Ten主题修改备忘(更新中……)
一、修改头部和底部宽度。打开style.css
191 192 193 194 195 | #site-info { float: left; font-size: 14px; font-weight: bold; width: 700px; |
700px改为auto。
351 352 353 354 355 356 | #site-title { float: left; font-size: 30px; line-height: 36px; margin: 0 0 18px 0; width: 700px; |
700改为640
363 364 365 366 367 368 | #site-description { clear: right; float: right; font-style: italic; margin: 15px 0 18px 0; width: 220px; |
220改为280
二、解决英文数字混合字符串不能自动换行,以及让文章页边距超出宽度自动隐藏。
http://www.3haow.com/wordpress-english-wrap/
编辑style.css,做如下修改:
472 473 474 475 476 | #content { margin-bottom: 36px; word-wrap:break-word; overflow: hidden; } |
三、添加文章阅读次数、百度分享按钮及文章顶端广告,复制文章自动加版权。
编辑loop-single.php,
29行修改为:
29 30 31 32 33 34 | <!--?php twentyten_posted_on(); ?--> 阅读 <!--?php if(function_exists('the_views')) { the_views(); } ?--> <del datetime="2014-10-07T22:49:32+00:00"><!-- Baidu Button BEGIN --> <div id="bdshare" class="bdshare_b" style="float: right; line-height: 12px;"><img src="http://bdimg.share.baidu.com/static/images/type-button-5.jpg" alt="" /> </div> <!-- Baidu Button END --></del> |
添加一个位置固定的百度分享按钮 http://zmingcx.com/fixed-baidu-share-button.html
37行添加广告代码:
50行添加版权代码:
四、底部添加统计代码、备案号,js代码。
编辑footer.php
六、2012年10月27日:
安装分布导航插件WP-PageNavi,修改了Twenty Ten主题的loop.php文件
WP-PageNavi增加nofollow(先添加后又删除,矛盾中……)
七、2012年10月28日:
添加关键词及描述代码(汉字变乱码解决方法),主题文件夹下上传了seobox.php,修改了functions.php和header.php。
2012年12月15日:
解决了英文标点变中文标点的问题。
八、2013年1月17日:
为文章列表的文章摘要末尾的more(继续阅读)链接添加nofollow属性。
九、清除WordPress twentyten主题评论框下的“HTML标签和属性”提示
十、禁止WordPress twentyten主题上传图片生成特色图像缩略图
十一、评论自动回复邮件
编辑functions.php
十二、JS代码由loop-single.php转移到single.php
十三、添加左侧百度分享按钮
添加方法:http://zmingcx.com/fixed-baidu-share-button.html
添加之后同时去除之前的百度分享代码。
十四、将WordPress后台的open-sans字体加载源从Google Fonts换为360 CDN
http://www.wpdaxue.com/dw-replace-open-sans.html
20160907去除该代码,因为Google已在国内增加服务器,字体可正常加载。
十五、20140816为“我爱Windows8 52windows8.com”添加了百度图+广告
在footer.php的/body标签前添加了广告代码。
十六、20141011去掉询问的“自豪地使用WordPree”字样
编辑footer.php,去掉如下代码:
<a href="<?php echo esc_url( __( 'http://wordpress.org/', 'twentyten' ) ); ?>" title="<?php esc_attr_e( 'Semantic Personal Publishing Platform', 'twentyten' ); ?>"><?php printf( __( 'Proudly powered by %s.', 'twentyten' ), 'WordPress' ); ?></a> |
十七、20141021添加侧边跟随百度分享按钮http://www.wpdaxue.com/add-baidu-share-bar.html
十八、20141130增大正文文本区域宽度,避免谷歌广告被遮挡
编辑style.css,将所有的640修改为728,940修改为1028。
390 391 392 393 394 395 | #access .menu-header, div.menu { font-size: 13px; margin-left: 12px; width: 928px; } |
修改为
390 391 392 393 394 395 | #access .menu-header, div.menu { font-size: 14px; margin-left: 15px; width: 1000px; } |
同时把左侧跟随百度分享的margin-left由-517修改为-561px;
functions.php中banner图片宽度header_image_width个性为1028
无觅图片大小由107改为120
十九、20141206增加右侧边栏宽度,以投放Google 300*600
编辑style.css,将所有的220修改为320,1028修改为1128。#content margin右边距280改为380
特别注意:#container的右边距由-240修改为-340,否则右侧边栏会错位到下面。
同时把左侧跟随百度分享的margin-left由-561修改为-611px;
functions.php中banner图片宽度header_image_width个性为1128。
右上方的网站描述site-description宽度由380修改为320;添加字体大小控制font-size: 10pt;
二十、在所有文章后添加Win10专业网链接
http://www.wpdaxue.com/add-custom-content-after-all-wordpress-posts.html