WordPress: Template Tags/category description:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
无编辑摘要
无编辑摘要
 
第1行: 第1行:
== Description ==
== 描述==
== 描述==


Returns the description of a category.
返回类别描述。
返回类别描述。
== Usage ==


== 用法 ==
== 用法 ==


%%% <?php category_description(category); ?> %%%
%%% <?php category_description(category); ?> %%%
%%% <?php category_description(category); ?> %%%
== Examples ==


== 例子 ==
== 例子 ==
===Default Usage===


===默认用法===
===默认用法===
Displays the description of a category with ID 3 by echoing the return value of the tag.


显示ID为3的类别描述,echoing标签的返回值。
显示ID为3的类别描述,echoing标签的返回值。
&lt;p&gt;<?php echo category_description(3); ?>&lt;/p&gt;
<div style="border:1px solid blue; width:50%; padding:10px">WordPress is a favorite blogging tool of mine and I share tips and tricks for using WordPress here.</div>


&lt;p&gt;<?php echo category_description(3); ?>&lt;/p&gt;
&lt;p&gt;<?php echo category_description(3); ?>&lt;/p&gt;


<div style="border:1px solid blue; width:50%; padding:10px">WordPress 是我最喜爱的一个写博客的工具,我在这里分享使用WordPress的小贴士和方法技巧。</div>
<div style="border:1px solid blue; width:50%; padding:10px">WordPress 是我最喜爱的一个写博客的工具,我在这里分享使用WordPress的小贴士和方法技巧。</div>
===With Category Title===


===用类别标题===
===用类别标题===
<pre><p><strong><?php single_cat_title('Currently browsing'); ?>
</strong>: <?php echo category_description(); ?></p></pre>


<pre><p><strong><?php single_cat_title('当期浏览'); ?>
<pre><p><strong><?php single_cat_title('当期浏览'); ?>
</strong>: <?php echo category_description(); ?></p></pre>
</strong>: <?php echo category_description(); ?></p></pre>
<div style="border:1px solid blue; width:50%; padding:10px">'''Currently browsing WordPress:''' WordPress is a favorite blogging tool of mine and I share tips and tricks for using WordPress here.</div>


<div style="border:1px solid blue; width:50%; padding:10px">'''当前浏览 WordPress:''' WordPress 是我最喜爱的一个写博客的工具,我在这里分享使用WordPress的小贴士和方法技巧。</div>
<div style="border:1px solid blue; width:50%; padding:10px">'''当前浏览 WordPress:''' WordPress 是我最喜爱的一个写博客的工具,我在这里分享使用WordPress的小贴士和方法技巧。</div>
== Parameters ==


== 参数==
== 参数==
; category : (''integer'') The numeric ID of the category for which the tag is to return the description. Defaults to the current category, if one is not set.


; 类别 : (''整数'') 标签需要返回描述的类别的ID数。如果没有设置,默认为当前的类别。
; 类别 : (''整数'') 标签需要返回描述的类别的ID数。如果没有设置,默认为当前的类别。
== Related ==
{{Tag Category Tags}}


{{Tag Footer}}
== 相关的 ==
== 相关的 ==



2008年7月8日 (二) 16:27的最新版本

描述[ ]

返回类别描述。

用法[ ]

%%% <?php category_description(category); ?> %%%

例子[ ]

默认用法[ ]

显示ID为3的类别描述,echoing标签的返回值。

<p><?php echo category_description(3); ?></p>

WordPress 是我最喜爱的一个写博客的工具,我在这里分享使用WordPress的小贴士和方法技巧。

用类别标题[ ]

<p><strong><?php single_cat_title('当期浏览'); ?>
</strong>: <?php echo category_description(); ?></p>
当前浏览 WordPress: WordPress 是我最喜爱的一个写博客的工具,我在这里分享使用WordPress的小贴士和方法技巧。

参数[ ]

类别
(整数) 标签需要返回描述的类别的ID数。如果没有设置,默认为当前的类别。

相关的[ ]

the_category, the_category_rss, single_cat_title, category_description, wp_dropdown_categories, wp_list_categories, in_category, get_category_parents, get_the_category get_category_link