<?php
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles' );
function theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
function my_get_the_date(){
list($the_date, $d, $post) = func_get_args();
if(preg_match('/(\d{4})年/',$the_date,$matches)!=0){
$buf = preg_replace('/\d{4}/', '皇紀'.($matches[1]+660),$the_date);
if(!is_null($buf)){
$the_date = $buf;
}
}
return $the_date;
}
add_filter('get_the_date', 'my_get_the_date',10,3);
function my_get_comment_date(){
list($date, $d, $comment) = func_get_args();
if(preg_match('/(\d{4})年/',$date,$matches)!=0){
$buf = preg_replace('/\d{4}/', '皇紀'.($matches[1]+660),$date);
if(!is_null($buf)){
$date = $buf;
}
}
return $date;
}
add_filter('get_comment_date', 'my_get_comment_date',10,3);