php 在Wordpress中添加当前年份短代码

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了php 在Wordpress中添加当前年份短代码相关的知识,希望对你有一定的参考价值。

© [year] My Business
<?php
// Creates [year] shortcode
function year_shortcode() {
$year = date('Y');
return $year;
}
add_shortcode('year', 'year_shortcode');
?>

以上是关于php 在Wordpress中添加当前年份短代码的主要内容,如果未能解决你的问题,请参考以下文章