• 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細

このWikiはいつでも誰でも編集できます

「テンプレートタグ/get the tag list」の版間の差分

提供: WordPress Codex 日本語版
移動先: 案内検索
(en:Template Tags/get_the_tag_list 2008年1月5日 (土) 20:45 MichaelH 版/Blowski, MichaelH 著)
 
(体裁調整のみ、未翻訳)
1行目: 1行目:
== Description ==
+
{{NeedTrans}}
 +
<div id="Description">
 +
== 説明 ==
 +
</div>
  
 
Generates a HTML string of the tags associated with the current post. The name of each tag will be linked to the relevant 'tag' page. You can tell the function to put a string before and after all the tags, and in between each tag. This tag must be used inside 'The Loop'.
 
Generates a HTML string of the tags associated with the current post. The name of each tag will be linked to the relevant 'tag' page. You can tell the function to put a string before and after all the tags, and in between each tag. This tag must be used inside 'The Loop'.
  
== Usage ==
+
<div id="Usage">
 +
== 使い方 ==
 +
</div>
  
 
This function does not display anything - if you want to put it straight onto the page, you should use <code>echo (get_the_tag_list())</code>. Alternatively, you can assign it to a variable for further use by using <code>$foo = get_the_tag_list()</code>.
 
This function does not display anything - if you want to put it straight onto the page, you should use <code>echo (get_the_tag_list())</code>. Alternatively, you can assign it to a variable for further use by using <code>$foo = get_the_tag_list()</code>.
9行目: 14行目:
 
The variables are all optional, and should be placed in the order 'before', 'separator', 'after'. You can use HTML inside each of the fields.
 
The variables are all optional, and should be placed in the order 'before', 'separator', 'after'. You can use HTML inside each of the fields.
  
== Example ==
+
<div id="Examples">
 +
== 用例 ==
 +
</div>
  
 +
<div id="A_Basic_Example">
 
=== A Basic Example ===
 
=== A Basic Example ===
 +
</div>
  
 
This outputs the list of tags inside a paragraph, with tags separated by commas.
 
This outputs the list of tags inside a paragraph, with tags separated by commas.
31行目: 40行目:
 
</pre>
 
</pre>
  
 +
<div id="A_Slightly_More_Complex_Example">
 
=== A Slightly More Complex Example ===
 
=== A Slightly More Complex Example ===
 +
</div>
  
 
This checks if the post has any tags, and if there are, outputs them to a standard unordered list.
 
This checks if the post has any tags, and if there are, outputs them to a standard unordered list.
53行目: 64行目:
 
You can add classes and styles with CSS, as necessary./
 
You can add classes and styles with CSS, as necessary./
  
 +
<div id="Parameters">
 +
== パラメータ ==
 +
</div>
  
{{Tag Tag Tags}}
+
== 変更履歴 ==
 +
* [[Version 2.3|2.3]] : 新規テンプレートタグ
  
 +
<div id="Related">
 +
== 関連 ==
 +
</div>
 +
{{Tag Tag Tags}}
 
{{PHP Function Tag Footer}}
 
{{PHP Function Tag Footer}}
[[Category:New page created]]
 
 
{{Stub}}
 
{{Stub}}
 +
 +
{{原文|Template Tags/get_the_tag_list|52742}}
 +
 +
{{DEFAULTSORT:get_the_tag_list}}
  
 
[[en:Template Tags/get_the_tag_list]]
 
[[en:Template Tags/get_the_tag_list]]

2008年4月2日 (水) 02:32時点における版

このページ「テンプレートタグ/get the tag list」は未翻訳です。和訳や日本語情報を加筆してくださる協力者を求めています

Generates a HTML string of the tags associated with the current post. The name of each tag will be linked to the relevant 'tag' page. You can tell the function to put a string before and after all the tags, and in between each tag. This tag must be used inside 'The Loop'.

使い方

This function does not display anything - if you want to put it straight onto the page, you should use echo (get_the_tag_list()). Alternatively, you can assign it to a variable for further use by using $foo = get_the_tag_list().

The variables are all optional, and should be placed in the order 'before', 'separator', 'after'. You can use HTML inside each of the fields.

用例

A Basic Example

This outputs the list of tags inside a paragraph, with tags separated by commas.

<?php
echo get_the_tag_list('<p>Tags: ',', ','</p>');
?>

This would return something like.

<p>
Tags: 
<a href="tag1">Tag 1</a>, 
<a href="tag2">Tag 2</a>, ... 
</p>

A Slightly More Complex Example

This checks if the post has any tags, and if there are, outputs them to a standard unordered list.

<?php
if(get_the_tag_list()) {
 get_the_tag_list('<ul><li>','</li><li>','</li></ul>');
}
?>

This will return something in the form:

<ul>
<li><a href="tag1">Tag 1</a></li>
<li><a href="tag2">Tag 2</a></li>
 ... 
</ul>

You can add classes and styles with CSS, as necessary./

パラメータ

変更履歴

  • 2.3 : 新規テンプレートタグ

タグ: get_tag(), get_tag_link(), get_tags(), get_the_tag_list(), get_the_tags(), is_tag(), the_tags(), single_tag_title(), tag_description(), wp_generate_tag_cloud(), wp_tag_cloud()


テンプレートタグへの PHP 関数型パラメータの渡し方関数リファレンステンプレートタグ目次もご覧ください。
このページ「テンプレートタグ/get the tag list」はまだ書きかけで、情報が不足しています。続きを書いて WordPress を手助けしましょう.


最新英語版: WordPress Codex » Template Tags/get_the_tag_list最新版との差分