wordpress模板标签the title attribute和single post title

作者:  耕堂 | 本文浏览612次 | 2009年08月25日

下面的两个标签也属于wordpress的post tags文章标签。

1.the title attribute

-描述:
显示或返回当前post的标题。它基本上复制了the_title的功能……
-使用:

<?php the_title_attribute(‘arguments’); ?>

-参数:

  • before
  • (字符串)标题前的文本。默认为”(无)。

  • after
  • (字符串)标题后的文本。默认为”(无)。

  • echo
  • (布尔)显示标题(1)或用php语句返回标题(0).默认为1。
    -例子:
    默认用法

    <?php the_title_attribute(‘before=<h3>&after=</h3>’); ?>

    这里有英文原版文档

    2.single post title

    -描述:
    当处于一个单文章页时显示或者返回文章标题。该标签在循环外可显示文章标题。
    -使用:

    <?php single_post_title( $prefix, $display ); ?>

    -默认用法:

    <?php single_post_title(‘prefix’ => ,

    ‘display’ => true ); ?>

    -参数:

  • $prefix
  • (字符串)(可选)标题前的文本。默认为 无 。

  • $display
  • (布尔)(可选)显示标题(1)或用php语句返回标题(0).默认为1。
    -例子:

    <h2><?php single_post_title(‘Current post: ‘); ?></h2>

    这里有英文原版文档

     右上方更多相关内容/站内搜索-关键词请用空格隔开

  • 标签 :  ,
  • 原文链接 : http://www.gengtang.net/wordpress/the-title-attribute-single-post-title.html
  • 转载原创文章请注明 : 耕堂-gengtang.net
  •  “wordpress模板标签the title attribute和single post title” 有1条评论

    1. 2009年8月26日的12:15 下午,传说中的 百合花

      我喜欢好看的WP模板

    发表留言

    可用HTML标签:<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>