您现在的位置是:首页 > 网站制作 > WordpressWordpress

WordPress函数single_month_title()

杰帅2023-08-06【Wordpress】人已围观

简介介绍

介绍

single_month_title() 用于返回“月”、“年”值,在date.php的archive页面,其他页面不支持。

使用

<?php single_month_title( $prefix, $display ) ?>

默认

<?php single_month_title(); ?>

参数

prefix
(string) (optional) 标题前返回值
Default: None
display
(boolean) (optional) Display the title (TRUE), or return the title to be used in PHP (FALSE).
Default: TRUE

返回

The generated title will be:

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

*February*2004

示例

月份和年换行:

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

使用 $my_month 变量
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; ?>

Tags:wordpress函数   WordPress建站   wordpress教程

很赞哦! ()

文章评论

本站推荐

站点信息

  • 建站时间:2018-10-24
  • 网站程序:帝国CMS7.5
  • 主题模板《今夕何夕》
  • 文章统计1172篇文章
  • 标签管理标签云
  • 统计数据百度统计
  • 微信公众号:扫描二维码,关注我们