Joomla!, Wordpress tips for building your site

How to show tag cloud with Wordpress

Published on| December 21st, 2009 | 2 Comments.

You can show the tag cloud very simple with WordPress.
For example, if you write theme (template) code like a following sample, you will be able to show tag cloud at your site at once.

<?php wp_tag_cloud('largest=18&#038;orderby=count&#038;order=desc'); ?>

In a word, you only use the standard tag (API of WordPress) prepared with WordPress.
It’s ver simple.()

wp_tag_cloud parameters.

Parameters

smallest
(integer) (optional) The text size of the tag with the smallest count value (units given by unit parameter).

Default: 8

largest
(integer) (optional) The text size of the tag with the highest count value (units given by the unit parameter).

Default: 22
unit
(string) (optional) Unit of measure as pertains to the smallest and largest values. This can be any CSS length value, e.g. pt, px, em, %.

Default: ‘pt’
number
(integer) (optional) The number of actual tags to display in the cloud. (Use ‘0’ to display all tags.)

Default: 45
format 
(string) (optional) Format of the cloud display.

  • 'flat' (Default) tags are separated by whitespace defined by ‘separator’ parameter
  • 'list' tags are in UL with a class=’wp-tag-cloud’
  • 'array' tags are in an array and function returns the tag cloud as an array for use in PHP Note: the array returned, rather than displayed, was instituted with Version 2.5.
separator
(string) (optional) The text/space between tags. Note: this parameter was introduced with Version 2.9.

Default: ‘/n’ (whitespace)
orderby 
(string) (optional) Order of the tags. Valid values:

  • 'name' (Default)
  • 'count'
order 
(string) (optional) Sort order. Valid values – Must be Uppercase:

  • 'ASC' (Default)
  • 'DESC'
  • 'RAND' tags are in a random order. Note: this parameter was introduced with Version 2.5.
exclude 
(string) (optional) Comma separated list of tags (term_id) to exclude. For example, ‘exclude=5,27’ means tags that have the term_id 5 or 27 will NOT be displayed. Defaults to exclude nothing.
include 
(string) (optional) Comma separated list of tags (term_id) to include. For example, ‘include=5,27’ means tags that have the term_id 5 or 27 will be the only tags displayed. Defaults to include everything.

link 
(string) (optional) Set link to allow edit of a particular tag. Note: this parameter was introduced with Version 2.7. Valid values:

  • 'view' (Default)
  • 'edit'
taxonomy 
(string) (optional) Taxonomy to use in generating the cloud. Note: this parameter was introduced with Version 2.8.

  • 'post_tag' – (Default) Post tags are used as source of cloud
  • 'category' – Post categories are used to generate cloud
  • 'link_category' – Link categories are used to generate cloud
echo 
(boolean) (optional) Show the result or keep it in a variable. The default is true (display the tag cloud). Note: this parameter was introduced with Version 2.8. Valid values:

  • 1 (true) – default
  • 0 (false)

<?php wp_tag_cloud('largest=18&#038;orderby=count&#038;order=desc'); ?>

In a previous example, the following parameters are used.

  • The text size of the tag with the highest count value: 18px
  • orderby: count
  • order: ‘DESC’

WordPress is very fine.()
In general, CMS will need extension(plug-in etc) if you want to show tag cloud, but WordPress can work with only default api.()

The tag cloud is the one that how much tag (word) is contained in the article is visually displayed.
It was assumed that this was better for SEO. (it’s long long ago? () I do not know now. )

However, regardless of SEO, I think it is interesting, because the reader can know summary of post at once by tag cloud.
However, if the writer doesn’t clearly write related tag, the tag cloud does not work very well.

If you want to work tag cloud very well, you must write clearly related tag at right side of editor.
tag_0






Comments

2 Responses to “How to show tag cloud with WordPress”

  1. Tweets that mention Wordpressでタグクラウドを表示する | Joomla!,Wordpressでサイトを構築するためのヒント — Topsy.com
    May 15th, 2010 @ 15:17:04

    […] This post was mentioned on Twitter by Hidenori Funaki. Hidenori Funaki said: メモです。Wordpressでタグクラウドを表示する。http://blog.off-soft.net/wordpress/tag_cloud.html […]

  2. ウィジェットなしでタグクラウドを表示させる | ゆる?くWebのこと
    August 11th, 2011 @ 18:01:56

    […] タグクラウド です。表示は wp_tag_cloud() を使います。   WordPressでタグクラウドを表示する – BLOG OFF SOFT.com   上記リンクを参考に、下記のコードは […]

Leave a Reply








Transrator

Recent Posts

Categories

Tag Cloud

execute remove フロントページ 投稿ページ トップページ install WIndows Note Convert META generator 日付 donwload file manage multibyte utf-8 unicode shiftjis euc console サイトマップ 問題 ParmaLink Redirect パーマリンク はみ出る pre テンプレート テーマ タグクラウド マルチランゲージ リダイレクト PHP(タグ) タグ table control HTML(タグ) コマンド 国際化(翻訳) SQLite(タグ) MySQL(タグ) qTranslate プラグイン(タグ) Wordpress(タグ)

Links

Site Description

Joomla!, Wordpress as CMS using a site building, site management, software usage to describe the development tips.

  • はてなブックマークへ追加する
  • Facebookでシェアする
  • twitter でつぶやく
  • Google Plusでシェアする
  • Pocketでシェアする
ページトップへ