Skip to content

Instantly share code, notes, and snippets.

@Olein-jp
Created December 18, 2018 05:57
Show Gist options
  • Save Olein-jp/045ced44c3475955b63cf3f0a0dd90dc to your computer and use it in GitHub Desktop.
Save Olein-jp/045ced44c3475955b63cf3f0a0dd90dc to your computer and use it in GitHub Desktop.
add_filter( 'widget_tag_cloud_args', 'my_widget_tag_cloud_args');
function my_widget_tag_cloud_args( $args) {
$args = array(
'smallest' => 10, // 最小のフォントサイズ:8[デ]
'largest' => 15, // 最大のフォントサイズ:22[デ]
'unit' => // フォントサイズ単位:'pt'[デ] CSSで使用できる単位pt, px, em, %
'number' => 20, // 表示タグ数の上限:45[デ]
'format' => // 表示フォーマット:'flat'(横並び)[デ]、'list'(縦並び <li></li>)、'array'(表示されない。他のPHPコード用に使用する場合)
'separator' => // 表示タグ毎の区切り '\n'[デ] (スペース)
'orderby' => // 並び替項目 'name'[デ](タグ名)、'count'(投稿数)
'order' => // 並び順 'ASC'(昇順)[デ]、'DESC'(降順)、'RAND'(ランダム)
'exclude' => // 除外するタグ 除外するタグのIDをカンマ区切りで列挙
'include' => // 表示するタグ 表示するタグのIDをカンマ区切りで列挙
'topic_count_text_callback' => //タグリンクにtitle属性を付与する関数 'default_topic_count_text'[デ](標準で"~件のトピック"と付けられます。)
'link' => // リンク先 'view'[デ](タグアーカイブページ)、'edit'(編集ページ)
'taxonomy' => // クラウドに表示する項目 'post_tag'[デ](タグ)、'category'(カテゴリー)、'link_category'(リンクカテゴリー)、'any other registered taxonomy'(全て)もしくは配列で複数指定する。
'echo' => // 表示有無 true(表示)[デ]、false(非表示:変数として使用する場合)
);
return $args;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment