WordPress: Template Tags/category description:修订间差异
来自站长百科
(新页面: == Description == Returns the description of a category. == Usage == %%% <?php category_description(category); ?> %%% == Examples == ===Default Usage=== Displays the description of ...) |
无编辑摘要 |
||
第1行: | 第1行: | ||
== Description == | == Description == | ||
== 描述== | |||
Returns the description of a category. | Returns the description of a category. | ||
返回类别描述。 | |||
== Usage == | |||
== | == 用法 == | ||
%%% <?php category_description(category); ?> %%% | |||
%%% <?php category_description(category); ?> %%% | %%% <?php category_description(category); ?> %%% | ||
== Examples == | == Examples == | ||
== 例子 == | |||
===Default Usage=== | ===Default Usage=== | ||
===默认用法=== | |||
Displays the description of a category with ID 3 by echoing the return value of the tag. | Displays the description of a category with ID 3 by echoing the return value of the tag. | ||
显示ID为3的类别描述,echoing标签的返回值。 | |||
<p><?php echo category_description(3); ?></p> | <p><?php echo category_description(3); ?></p> | ||
<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> | <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> | ||
<p><?php echo category_description(3); ?></p> | |||
<div style="border:1px solid blue; width:50%; padding:10px">WordPress 是我最喜爱的一个写博客的工具,我在这里分享使用WordPress的小贴士和方法技巧。</div> | |||
===With Category Title=== | ===With Category Title=== | ||
===用类别标题=== | |||
<pre><p><strong><?php single_cat_title('Currently browsing'); ?> | <pre><p><strong><?php single_cat_title('Currently browsing'); ?> | ||
</strong>: <?php echo category_description(); ?></p></pre> | |||
<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">'''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> | |||
== Parameters == | == 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. | ; 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数。如果没有设置,默认为当前的类别。 | |||
== Related == | == Related == | ||
第33行: | 第59行: | ||
{{Tag Footer}} | {{Tag Footer}} | ||
== 相关的 == | |||
{{标签 类别标签}} | |||
{{标签 页底文字}} |
2008年6月28日 (六) 17:10的版本
Description
描述
Returns the description of a category. 返回类别描述。
Usage
用法
%%% <?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标签的返回值。
<p><?php echo category_description(3); ?></p>
WordPress is a favorite blogging tool of mine and I share tips and tricks for using WordPress here.
<p><?php echo category_description(3); ?></p>
WordPress 是我最喜爱的一个写博客的工具,我在这里分享使用WordPress的小贴士和方法技巧。
With Category Title
用类别标题
<p><strong><?php single_cat_title('Currently browsing'); ?> </strong>: <?php echo category_description(); ?></p>
<p><strong><?php single_cat_title('当期浏览'); ?> </strong>: <?php echo category_description(); ?></p>
Currently browsing WordPress: WordPress is a favorite blogging tool of mine and I share tips and tricks for using WordPress here.
当前浏览 WordPress: WordPress 是我最喜爱的一个写博客的工具,我在这里分享使用WordPress的小贴士和方法技巧。
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数。如果没有设置,默认为当前的类别。
Related
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,
相关的
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