Displays or returns the tag title for the current archive page.
<?php single_tag_title( $prefix, $display ); ?>
<?php single_tag_title(); ?>
$prefix
(string) (可选) Text to output before the title.
默认值: None
Note: The $prefix argument is currently ignored if the $display argument is false.
See http://core.trac.wordpress.org/ticket/16632
$display
(boolean) (可选) Display the title (TRUE), or return the title to be used in PHP (FALSE).
默认值: TRUE
This example displays the text “Currently browsing ” followed by the tag title.
1
2
3
4
|
/* ———————————-
* wordpress之魂 © http://wphun.com
* ———————————- */
<p><?php single_tag_title(‘Currently browsing ‘); ?>.</p>
|
This example assigns the current tag title to the variable $current_tag for use in PHP.
1
2
3
4
|
/* ———————————-
* wordpress之魂 © http://wphun.com
* ———————————- */
<?php $current_tag = single_tag_title(“”, false); ?>
|