• 22-04-2019, 21:31:23
    #1
    Merhaba 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..

    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;
        }
    }
  • 22-04-2019, 21:40:30
    #2
    Google 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
    Seo açısından "22 Ma. yerine 22 Mart" bu şekilde kullanılması daha iyi olur.

    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:46:35
    #3
    Teşekkürler bilgilendirme için, kısaltmadan uzun olarak ta göstersem işimi görür. Kodları nasıl değiştireceğim veya ne ekleyeceğim?
  • 22-04-2019, 21:47:00
    #4
    http://www.yunusbassahan.com/blog/ph...onksiyonu.html

    Burada analtmış hocam.
  • 22-04-2019, 22:00:31
    #5
    hocam dediğiniz yöntem anlık tarihi çekiyor, benim demek istediğim yayınlanan dizinin tarihini Türkçeye çevirmek..
  • 22-04-2019, 22:11:01
    #6
    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:15:47
    #7
    Onur89TR adlı üyeden alıntı: mesajı görüntüle
    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?
    maalesef sonuç aynı
  • 22-04-2019, 22:20:02
    #8
    Wordpress 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;
    }
    }
  • 22-04-2019, 22:34:18
    #9
    setlocale(LC_TIME, "turkish"); 
    setlocale(LC_ALL,'turkish'); 
    echo strftime(' %d %B %Y ',strtotime('Jan. 25, 2019'));