Doğru Cevap
-
"SELECT ID, post_title FROM $wpdb->posts WHERE post_status ='publish' ORDER BY ID DESC LIMIT 0,$kac_tane_yazi_gosterilsin"
yerine"SELECT * FROM $wpdb->posts WHERE post_status ='publish' ORDER BY ID DESC LIMIT 0,$kac_tane_yazi_gosterilsin"
şeklinde postun tüm değerlerini çekersen foreach döngünden hemen önce ve sonra aşağıdaki kodları uygularsanglobal $yazi; foreach ($yazilar as $yazi): setup_postdata($yazi);
the_ID(); - the_title(); - the_time('F jS, Y'); - the_date('Y-m-d') gibi fonksiyonları kullanabilirsin.
bu durumda
the_date('d m'); şeklinde kullanım işini görecektir. bu fonksiyon otomatik olarak echo verecektir.
2. olarak da select sorguna post_date i de ekliyerek date i de çeker ve kendine uygun formatlamayı yaparsın. "php format date" diye kime sorsan gösterir :D-
sevketbulamaz
bu arada referans;
http://codex.wordpress.org/Displaying_Posts_Using_a_Custom_Select_Query
ve
http://codex.wordpress.org/Function_Reference/the_date11 yıl önce yazılmış
-
Cevaplar
Hiç cevap bulunamadı.