WordPressにタグクラウドを実装
このブログにタグクラウドを実装してみました。プラグインで実装するのかと思っていたのですが、調べてみたらWordPress2.3からタグクラウド用のタグがサポートされているとか…WordPressMEの取り残されっぷりに、ちょっと泣けてきました。
WordPress.ORG Template Tags/wp tag cloud
- タグクラウドを表示するテンプレートタグ
- < ?php wp_tag_cloud(”); ?>
- 使用できるパラメータ
- smallest - The smallest tag (lowest count) is shown at size 8
- largest - The largest tag (highest count) is shown at size 22
- unit - Describes ‘pt’ (point) as the font-size unit for the smallest and largest values
- number - Displays at most 45 tags
- format - Displays the tags in flat (separated by whitespace) style
- orderby - Order the tags by name
- order - Sort the tags in ASCENDING fashion
- exclude - Exclude no tags
- include - Include all tags
あう、英語ばかりじゃないっすか。(´・ω・`)ショボーン
海外の有用なリソースが、英語が読めないという理由だけで活かせないのは常々もったいないと思っていたのですが、読めないものは仕方が無い…。
以下、苦手な英語に悩まされながら進めた、作業手順の覚書です。
- タグクラウドを表示させたい所に< ?php wp_tag_cloud(”); ?>を挿入
- テンプレートにtag.phpを追加、編集
- custom-query-stringプラグイン(3.0)が、タグページに対応していなかったので改造(※)
※custom-query-string.phpの53行目を以下に編集
var $conditions = array('is_feed', 'is_paged', 'is_author', 'is_category', 'is_time', 'is_day', 'is_month', 'is_year', 'is_date', 'is_archive', 'is_search', 'is_home', 'is_robots', 'is_admin', 'is_tag');
Posted at 2008.4.21

コメント&トラックバック
トラックバックURL: http://aquila-lab.net/log/archives/49/trackback