Template Tags/single month title

Материал из WordPress Wiki

Перейти к: навигация, поиск

Содержание

Description

Displays or returns the month and year title for the current page. This tag only works when the m or archive month argument has been passed by WordPress to the current page (this occurs when viewing a monthly archive page). Note: This tag only works on date archive pages, not on category templates or others.

Usage

%%% <?php single_month_title('prefix', display) ?> %%%

The generated title will be:

prefix + MONTH + prefix + YEAR

If prefix parameter is '*', an example would be:

*February*2004

Examples

Month and Year on New Lines

Displays the title, placing month and year on new lines.

<p><?php single_month_title('<br />') ?></p>
December
2004


Using $my_month Variable

Returns the title, which is assigned to the $my_month variable. The variable's value is then displayed with the PHP echo command.

<?php $my_month = single_month_title('', false); echo $my_month; ?>


Parameters

prefix 
(string) Text to place before the title. There is no default.
display 
(boolean) Display the title (TRUE), or return the title to be used in PHP (FALSE). Defaults to TRUE.

Related

Шаблон:Tag Date Tags

Шаблон:PHP Function Tag Footer

Реклама

Читайте обзор программ от WhitePortal.ru