Posted on 01/31/2012, 21:40, by badst, under
个人日志.
白色主题上传上来就出问题了,编辑文章的时候出现这个错误,网上搜到很多,但都没办法解。 Warning: Cannot modify header information – headers already sent by (output started at /home/badst/domains/badst.host7.meyu.net/public_html/wp-content/themes/Spring2012/functions.php:1) in/home/badst/domains/badst.host7.meyu.net/public_html/wp-includes/pluggable.php on line 866 还有在Chrome下看到<body>跑到了<head>前面。。。我已经把所有php文件转成UTF8编码了,本来本地测试一点问题都没有的。 现在后台所有动作,修改主题什么的都会出现这个错误,虽然修改的效果已经实现。烦躁中!!! 原因:是utf-8文件BOM头在作怪。我用的是Notepad++,保存为不含BOM头的文件,问题解决了。
Posted on 01/31/2012, 09:25, by badst, under
小技巧.
此方法仅限于不使用后台外观里的小工具拖出来的评论列表,必须自己在sidebar.php里加代码。 Code: <!– start sidecomments–> <li> <h2>最新评论</h2> <ul class=”nav-comment-content”> <?php global $wpdb; $sql = “SELECT DISTINCT ID, post_title, post_password, comment_ID, comment_post_ID, comment_author, comment_author_email, comment_date_gmt, comment_approved, comment_type,comment_author_url, SUBSTRING(comment_content,1,20) AS com_excerpt FROM $wpdb->comments LEFT OUTER JOIN $wpdb->posts ON ($wpdb->comments.comment_post_ID = $wpdb->posts.ID) WHERE comment_approved = ’1′ AND comment_type = ” AND post_password = ” ORDER BY comment_date_gmt DESC [...]
Posted on 01/29/2012, 10:54, by badst, under
推荐阅读.
在苹果的网站页面的source里看到这张图片,地址是: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAANCAYAAABy6%2BR8AAAAlElEQVR42oWQQRHEIAxF10ElVAISVgo3bCABCUhYCZWAhEpAQpoD6bzJhNnDO0DyyA8fEXkppXyVCpLViDUfyqVIQN9JFMY637hrlCySFauL21E7KVWbAIGx56rnSLqc5KPXSLo3kySalPhTygFhRDtFC09EIsMeZJSGBj7Qveh3OJW89syImiH%2BIO2BOJX0XwA2%2BQEL4pAhSX4aBQAAAABJRU5ErkJggg%3D%3D 就很奇怪这是哪里的图片?远程的?本地的?在CSDN上问人才知道这个叫Data URI scheme 网页优化的一大首要任务是减少HTTP 请求 (http request) 的次数,例如通过合并多个JS文件,合并CSS样式文件。除此之外,还有一个data URL 的密技,让我们直接把图像的内容崁入网页里面,这个密技的官方名称是 data URI scheme 。 Data URI scheme 的语法: <img src=”data:image/png;base64,iVBOR….> 它包含一下部分:
Posted on 01/25/2012, 22:29, by badst, under
技术教程.
PHP环境搭建:Win7下安装配置Apache(2.2.21)+php(5.39)+Mysql(5.5.19) 步骤一:下载 PHP 5.3 (5.3.9) VC9 x86 Thread Safe 文件名:php-5.3.9-Win32-VC9-x86.msi [38.44MB] sha1: 7c75a4c19c256b5b6d2e6dd5958402f5fd1def42 下载地址:http://windows.php.net/download/ MySQL Installer 5.5.19 文件名:mysql-installer-5.5.19.0.msi [209MB] MD5: cc20bb782c76de9f1c61507e85f88cec 下载地址:http://dev.mysql.com/downloads/installer/ Apache 2.2.21 (released 2011-09-13) httpd-2.2.21-win32-x86-openssl-0.9.8r.msi [5.56MB] 下载地址:http://httpd.apache.org/download.cgi
Posted on 01/17/2012, 20:40, by badst, under
个人日志.
完全偷paragon的样式,Google Chrome的审查元素功能太好用了。。 comments.php里死活找不到样式在哪改的?搜了下 <?php wp_list_comments(‘type=comment&callback=mytheme_comment’); ?> 这个函数,才找到WordPress官方codex说明里的用法。原来样式是在function.php里面,果断改掉了。 You will need to define your custom callback function in your theme’s functions.php file. Here is an example: 上一篇/下一篇中的圆角方块效果 #artical ul.prevnext a { color: gainsboro; text-shadow: #191919 1px 1px 0; background: url(“images/pagination_bg.png”) repeat-x; padding: 6px 11px; font-size: 0.9em; border-radius: 5px; -webkit-border-radius: 5px; -moz-border-radius: 5px; box-shadow: 1px 1px 3px [...]