↓ Archives ↓

Posts Tagged → wordpress

去除Wordpress中的’wp-’前缀

在wordpress mu (wpmu)平台基础上制作了一个网站,但不希望网址中带有’wp-’这样的前缀。不知道这种想法是否邪恶,是否违反了wordpress的使用协议?

参考了 狗头猪脑 的文章

  1. 使用类似TextMate的编辑器打开wpmu文件夹,使用”Find in Project” (shift+ ⌘ + F),查找’wp-’ (可不是’wp_’哟),并用”(替换栏位留空)替换。然后存储所有文件(Save all)。
  2. 修改wpmu目录中所有带有’wp-’的文件名,删除’wp-’。
  3. 把wp-admin, wp-includes, wp-content三个文件夹名字的’wp-’去掉。
  4. 这里还是希望保留数据库中的’wp_’前缀,所以并不修改config.php中的数据库前缀。
  5. 开始运行网站并调试:现在网站一定显示空白给你看!可查看你的网页服务器的error_log,来判定出错位置,比如:

PHP Parse error:  syntax error, unexpected ‘>’, expecting T_VARIABLE or ‘ in …/includes/rewrite.php on line 44

说明需要修改文件rewrite.php,在’$'后面加入’wp-’。

嵌入适合blog宽度的picasa图片

图片显示一定程度上决定blog的美观程度。特别是post中图片的尺寸是挑选blog程序或主题的部分决定因素。图片不能太小,看不清楚,留白太多;更不能太宽,超出post尺寸或占据sidebar区域…

所以今天一装完wordpress,就赶紧开始picasa图片嵌入的实验。使用wordpress本身图片上传工具不能解决吗?这就是使用Picasa的理由– free, big disk, and no banned basically… 

OK!之前使用blogger有一些picasa的经历,就是说Picasa web仅提供四种尺寸嵌入,如右图。但今天搜索”picasa wordpress 400 800″,发现阅微堂主有提到Web Picasa API,Google实际上有更多的输出尺寸:

The following values are valid for the thumbsize and imgmax query parameters and are embeddable on a webpage. These images are available as only uncropped(u) sizes by appending u to the size or just passing the size value without appending anything.

200, 288, 320, 400, 512, 576, 640, 720, 800

于是实验了一下,果真如此,下图就是选用了“576”这个输入尺寸,正好适合wordpress这个theme的post width。改用方法就是将google提供的picasa ‘embed image’代码拷贝过来,然后修改img URL中的’s400′为’s576′或者你想要的尺寸。
广东省河源市野趣沟,2008年秋

上图:广东省河源市野趣沟,2008年秋

Wordpress banner management

Oooh, great keyword: banner management! 

First I try to modify Sitebar widget to make an advertising system. That’s difficult. Then I use ‘advertising’ to search the relative articles. I almost lose hope to find it. 

Then I found ‘WP-banner’— someone has said that it is the best banner management plugin he found. But, really, it’s not a good one for wpmu although it will work if you manual install its database table.

Then, I found ‘WPAds’ on WPAds after going through the Great Wall. I think it is a better one because someone made a comment about wpmu. I’m glad to hear that it works perfectly on wpmu.

Wordpress categories as tags

Category is obsolete and tag is modern!

So some wordpress fans are trying to find efficient tags system by utilizing native Categories. 

I got Category Tagging plugin for wordpress. Make cattag_tagcloud function to dispay 5 or more popular tags ( yes, are originately Categories). Also I have activated Sitebar Widget. 

I make a slight modification on the function cattag_tagcloud. Just add a variable: $max_display. It means that how many tags will be displayed.