function doo_post_date($format = false, $echo = true){
if(!is_string($format) || empty($format)) {
$format = 'F j, Y';
}
$date = sprintf( __d('%1$s') , get_the_time($format) );
if($echo){
echo $date;
} else {
return $date;
}
} Tarihi Türkçeye çevirmek?
9
●335
- 22-04-2019, 21:31:23Merhaba arkadaşlar, elimde dizi teması var sunucudan dizi bölümleri çekince ingilizce olarak alıyor. Örnek: Jan. 25, 2019 . Ben bunu 25 Oca. 2019 olarak göstermek istiyorum. Uğraştım fakat yapamadım yardımlarınızı bekliyorum..
- 22-04-2019, 21:40:30Google son güncellemelerden bir tanesi tarih gösterimi ile alakalı idi.
Aklımda kaldığı kadarıyla;- 22-04-2019
- 22/04/2019
- 22-Mart-2019
- 22/Mart/2019
Google resmi blog hesabında bu konu ile ilgili dokümana ulaşabilirsiniz.
Göz atmanızı tavsiye ederim:
https://schema.org/Date
https://schema.org/dateModified
https://schema.org/datePublished - 22-04-2019, 21:47:00
- 22-04-2019, 22:11:01
function doo_post_date($format = false, $echo = true){ setlocale(LC_TIME, 'tr_TR'); if(!is_string($format) || empty($format)) { $format = '%e %B, %Y'; } $date = sprintf( __d('%1$s') , get_the_time($format) ); if($echo){ echo $date; } else { return $date; } }Bu şekilde sonuç nedir? - 22-04-2019, 22:20:02Wordpress bu sanırım.
Wordpress yükleme dili Türkçe olduğuna emin misiniz?
Dil değiştirme ile uğraşmak istemiyorsanız yukarıda paylaştığınız kodu şöyle değiştirin.
function doo_post_date($format = false, $echo = true){ if(!is_string($format) || empty($format)) { $format = 'j F Y'; } $date = sprintf( __d('%1$s') , get_the_time($format) ); $ingilizce = array("Jan","Feb","Mar","May","Apr","Jun","Jul","Aug","Sep","Oct","Nov","Dec"); $turkce = array("Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara"); $date = str_replace($ingilizce,$turkce,$date); if($echo){ echo $date; } else { return $date; } }