日志标签 ‘技巧’

让用户把你网站的链接保存到桌面上

2010年2月7日

新建一个PHP文档:名字好记就行如:001.php

PHP文档中的内容:

<?php
$Shortcut = "[InternetShortcut]
URL=http://www.kubai.net/
IDList=
[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
";
Header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=酷白网-建站博客.url;");
echo $Shortcut;
?>

要想出现图标请先确保网站根目录中有 favicon.ico 文件

上传到网站,访问地址:如:http://www.kubai.net/001.php 就会有提示下载一个名为 酷白网-建站博客.urll文件,保存在本地就是一个快捷方式!

WordPress2.9 首行缩进功能的实现

2010年1月15日

WordPress更新2.9之后,发现自动缩进的没了,于是网上Google了一下,记录下来,下次就可以直接用了。

在wp-includes/js/quicktags.js文件中找到More标签这行

edButtons[edButtons.length]=new edButton("ed_more","more","< !–more–>","","t",-1);

在后面添加

edButtons[edButtons.length]=new edButton(‘ed_para2em’,'para2em’,'< p style="text-indent:2em">’ ,’< /p>’,'pa’);

WordPress的 .htaccess技巧

2010年1月15日

1. 重定向WordPress的订阅地址
除了修改WordPress的模板文件来定制其输出的RSS Feed链接地址外,还可以使用.htaccess文件来进行设置(替换yourrssfeedlink为自己的Feedburner地址)。
# temp redirect wordpress content feeds to feedburner<IfModule mod_rewrite.c>RewriteEngine onRewriteCond %{HTTP_USER_AGENT} !FeedBurner [NC]RewriteCond %{HTTP_USER_AGENT} !FeedValidator [NC]RewriteRule ^feed/?([_0-9a-z-]+)?/?$ http://feeds2.feedburner.com/catswhocode [R=302,NC,L]</IfModule>参考:How to redirect WordPress rss feeds to feedburner

» 阅读更多: WordPress的 .htaccess技巧