Habari插件Post Fields

2009-01-16 4:09 pm

爱上Habari超级简洁的文章编辑界面:Title(标题)、Content(内容)、Tags(标签,可选)、Content Address(文章地址,可选),完成这几项就可以发布,简单够用。如果是Wordpress用户可能会怀念Excerpt(摘要)和Custom Fields(自定义字段),要Habari实现这些功能也很简单,我们需要用到插件Post Fields

下载—解压缩—上传到/user/plugins目录下,到后台插件列表里面激活,激活后在Active Plugins(已激活插件)中找Post Fields选择Configure,点击add选择你想添加的项目。在下面的视图中,我添加的是keywords和description,准备在header.php文件中以head meta的形式出现,作用是告知搜索引擎这篇文章的关键词和简述:

Post Fields设置

这个时候在撰写文章的界面下方就会多出一条Additional Fields(附加字段),在写文章的时候填入相应的内容即可。

填写Post Fields

怎么使用我们填入的这些文字呢?就本例而言,我们需要编辑header.php,在<head>...</header>之间加入:

<meta name="keywords" content="<?php echo $post->info->keywords; ?>" />
<meta name="description" content="<?php echo $post->info->description; ?>" />

各位可以右键单击本页,选择查看源代码,就可以看到本页的html代码中已经添加好了meta keywords和description。熟悉Wordpress自定义字段的人一定可以很快上手,如果熟悉Habari主题结构的话,灵活使用可以实现多种功能。Post Fields插件的介绍到此结束,各位就慢慢研究吧。

Habari插件Post Fields 有0条评论
  1. 不想说点什么?
关于您
评论框