Using TimThumb with WordPress Post Thumbnails

The WordPress post thumbnails functionality has become a basic necessity of theme coding, but it does have its limitations. Mainly you are stuck with the image sizes you specify in the Settings – Media tab. You can also specify your own image sizes, but clients undoubtedly want to change their image sizes over time or within one website over and over and over and over…. So it makes sense to make use of the dynamic image resizing script TimThumb. I use the following technique to grab the designated featured image post thumbnail from a post and then automatically resize it upon display. Works perfectly!

继续阅读“Using TimThumb with WordPress Post Thumbnails”

WordPress后台升级免输入FTP帐号

新版的WordPress自带了插件自动升级的功能。每次安装的插件有了新版本,只要点一个链接,就自动完成下载、解压、禁用插件、升级、重新启用这一系列步骤。常方便。但有些空间选择升级时会提示需要主机的FTP用户名和密码。

这个blog安装在linux系统上,第一感觉可能是权限的问题,反正是内部的服务器,随便折腾,就都设置成777。结果还是不行,就仔细地跟进去查了一下,发现问题在一个叫做“get_filesystem_method”的函数上。找到这样一个解释:

(FTP) it only uses this when it detects that files it creates have the wrong owner name

一下得到了提醒,可能是因为跑PHP进程的用户名和WP文件夹的所有者不同。于是用chown命令更改了文件所有者,命令用法如下:

chown -R www *

就是把目录下所有文件和文件夹的所有者改成叫做www的用户。这样再去尝试WP的自动升级,一键升级就能顺利进行了。

WordPress插件“Simple Tags”1.8版本错误修正

在WordPress 3.0 以下版本安装版本号为1.8的Simple Tags插件后,如果使用该插件的Tag cloud 功能,则会提示错误,如图所示:

clip_image002

该错误发生在plugins/simple-tags/inc/client.php文件中第1699行中,taxonomy_exists()函数不存在。经查,该函数是在wordpress 3.0中新增,用来替换原来的is_taxonomy()函数。

解决办法,升级到wordpress 3.0 或 将Simple Tags中taxonomy_exists()修改为is_taxonomy()

用phpMyAdmin操作WordPress数据库

WordPress有丰富的插件、主题,成功广大博主建博客利器,WordPress博客是由MySQL提供支持的,在博客的写作过程中,有时不得不牵扯到一些对MySQL数据库的操作,虽然,插件和代码的修改也能帮我们解决问题,但是,这也是治标不治本的丰富,随意,合理的利用phpMyAdmin来进行数据的操作的十分有必要的。

继续阅读“用phpMyAdmin操作WordPress数据库”

A wonderful free wordpress themes site

I have been looking for WP templates on WordPress.org until I found this site:wprex.com, “which provides a number of finest quality and innovative WP themes”, in their words. But I suppose that, despite it does not have as many themes as WordPress.org has, it provides more elaborate and more Multifunction templates as they can. In addition, the more detailed Specification helps me to find my favor themes a lot. So I recommend this wordpres​s themes​ site. By the way, it is wholly free and Easy to download wordpress templates without login or any hassle.

Please visit : http://www.wprex.com and find your themes in your style.

wprex

解决Twitter tools 中文链接问题

使用Twitter tools 插件,可以将最新的Post发送到Twitter上,确实很方便。由于我的永久链接(permalink)格式为

/archives/%postname%.html

文章链接中含有文章标题,当标题为中文的时候不太美观,所以用cos_slug_translator这个插件将中文标题转换为英文。但是我用Twitter Tools的时候就出现了问题:发送到Twitter上的链接依然含有中文,访问的话就是404错误。

继续阅读“解决Twitter tools 中文链接问题”

去除WordPress header 的 link 标签 rel 属性

WordPress 在 2.8 版本之后,增加了几个新的 link 标签 rel 属性,例如:

<link rel="index" title="Sino Blog" href="http://www.sinoblog.org" />
<link rel="start" title="Hello World" href="http://www.sinoblog.org/2007/09/hello-world.html" />
<link rel="prev" title="QQ邮箱支持域名邮箱个性化邮件服务" href="http://www.sinoblog.org/2009/09/qq-domainmail.html" />

如果要去掉 WordPress 博客 header 部分的这些 rel 属性,可以通过修改主题支持函数(functions.php)来实现,规则是:

remove_action( $tag, $function_to_add, $priority, $accepted_args );

例如,要去掉下面的这些 link 标签:

<link rel="alternate" type="application/rss+xml" title="WP Engineer RSS Feed" href="http://www.aliyoga.com/yujia/feed/" />
<link rel="alternate" type="application/atom+xml" title="WP Engineer Atom Feed" href="http://www.aliyoga.com/yujia/feed/atom/" />
<link rel="pingback" href="http://www.aliyoga.com/yujia/xmlrpc.php" />
<link rel="EditURI" type="application/rsd+xml" title="RSD" href="http://www.aliyoga.com/xmlrpc.php?rsd" />
<link rel="index" title="WP Engineer" href="http://www.aliyoga.com" />
<link rel="start" title="Use WordPress 2.7 Offline" href="http://www.aliyoga.com/shop/" />
<link rel="prev" title="Recents Drafts All Authors" href="http://www.aliyoga.com/bbs/" />

分别对应的 remove_action 代码是:

remove_action( 'wp_head', 'feed_links_extra', 3 ); // Display the links to the extra feeds such as category feeds
remove_action( 'wp_head', 'feed_links', 2 ); // Display the links to the general feeds: Post and Comment Feed
remove_action( 'wp_head', 'rsd_link' ); // Display the link to the Really Simple Discovery service endpoint, EditURI link
remove_action( 'wp_head', 'wlwmanifest_link' ); // Display the link to the Windows Live Writer manifest file.
remove_action( 'wp_head', 'index_rel_link' ); // index link
remove_action( 'wp_head', 'parent_post_rel_link', 10, 0 ); // prev link
remove_action( 'wp_head', 'start_post_rel_link', 10, 0 ); // start link
remove_action( 'wp_head', 'adjacent_posts_rel_link', 10, 0 ); // Display relational links for the posts adjacent to the current post.
remove_action( 'wp_head', 'wp_generator' ); // Display the XHTML generator that is generated on the wp_head hook, WP version

在一个老外的博客看到的,记录一下
本文来源于Sino Blog http://www.sinoblog.org , 原文地址: http://www.sinoblog.org/2009/09/cleanup-wordpress-header-link-rel.html