把这段代码放在functions.php里面,可以在你的页面和日志标题上附加日期 1    add_filter( 'wp_title', 'append_to_title', 10, 3 ); 2    function append_to_title($title) { 3        $date = get_the_date(); 4        return $title .= " | ".$date; 5    }

把这段代码放在functions.php里边,能够在你的页面日志标题上附加日期

日志以及页面附加日期(附加日志是什么)  使用技巧 日志 附加日期 页面 新闻资讯 第1张

1 add_filter( 'wp_title', 'append_to_title', 10, 3 );
2 function append_to_title($title) {
3 $date = get_the_date();
4 return $title .= " | ".$date;
5 }

转载请说明出处
知优网 » 日志以及页面附加日期(附加日志是什么)

发表评论

您需要后才能发表评论