我要投稿 | 网站地图 WordPress建站学习平台
WordPress教程网
热门标签: wordpress教程 wordpress函数 wordpress WordPress建站 wordpress插件

图文教程

当前位置:首页> 图文教程

WordPress函数get_calendar()日历标签

发布:WordPress教程网   发布时间: 2023-02-06  游览次数:23次

介绍

get_calendar()是一个WordPress日历标签,可以在 WordPress主题 的任意模板中使用,并不需要在 the_loop 中。

默认会显示当前年月的一个日历,并且会在有日志的日期中带上日期的 date 链接。

使用

<?php get_calendar( $initial, $echo ); ?>

参数

$initial
(boolean) (optional) If true, the day will be displayed using a one-letter initial; if false, an abbreviation based on your localization will be used.
Default: True
False - causes "Sunday" to be displayed as "Sun"
True - causes it to be "S"
$echo
(boolean) (optional) Determines whether or not the calendar should be displayed.
Default: True
False - Returns calendar, but does not echo it to screen
True - Echos calendar, but does not return it to a variable

示例

默认使用

显示日历,突出显示任何带帖子的日期。

<?php get_calendar(); ?>

显示工作日缩写

仅使用一个字母的首字母显示天数; 在1.5中,根据您的WordPress本地化显示初始值。

 <?php get_calendar(true); ?> 

本文版权归原作者所有,转载请注明原文来源出处, WordPress教程网 感谢您的支持!

本文链接: http://www.wpcn.net/814.html

WordPress教程网
WordPress教程网
相关内容