Ben Wordpress ile çalışan ve geçerli gün oluşturulan tüm mesajların gelen bilgi almak için çalışıyorum. Benim kod anda bu gibi görünüyor:
$today = getdate();
$posts = get_posts('year=' .$today["year"] .'&monthnum=' .$today["mon"] .'&day=' .$today["mday"] );
$CurrentPost = array($posts[0]);
$Post_Date = $CurrentPost[post_date];
echo "Post Date: $Post_Date ";
Ancak, Mesaj tarihi null alıyorum. Ben doğru veri yapısı erişim muyum? Ben $ ileti dizisindeki bir print_r yaptığınızda, ben şu olsun çünkü veriler, orada olduğunu biliyorum:
Array ( [0] => stdClass Object ( [ID] => 4 [post_author] => 1 [post_date] => 2011-01-01 02:59:09 [post_date_gmt] => 2011-01-01 02:59:09 [post_content] => This Post created Friday December 31st, 2010 [post_title] => Test Post 1 [post_excerpt] => [post_status] => publish [comment_status] => open [ping_status] => open [post_password] => [post_name] => test-post-1 [to_ping] => [pinged] => [post_modified] => 2011-01-01 02:59:09 [post_modified_gmt] => 2011-01-01 02:59:09 [post_content_filtered] => [post_parent] => 0 [guid] => http://localhost/wordpress/?p=4 [menu_order] => 0 [post_type] => post [post_mime_type] => [comment_count] => 0 [filter] => raw ) [1] => stdClass Object ( [ID] => 1 [post_author] => 1 [post_date] => 2011-01-01 02:43:02 [post_date_gmt] => 2011-01-01 02:43:02 [post_content] => Welcome to WordPress. This is your first post. Edit or delete it, then start blogging! [post_title] => Hello world! [post_excerpt] => [post_status] => publish [comment_status] => open [ping_status] => open [post_password] => [post_name] => hello-world [to_ping] => [pinged] => [post_modified] => 2011-01-01 02:43:02 [post_modified_gmt] => 2011-01-01 02:43:02 [post_content_filtered] => [post_parent] => 0 [guid] => http://localhost/wordpress/?p=1 [menu_order] => 0 [post_type] => post [post_mime_type] => [comment_count] => 1 [filter] => raw ) )
Ben sadece doğrudan ben geçerli gün yazılı mesajların olmayan bir html çıktı üretmek böylece bir dizi çağırarak sanki her yazı, her öğe erişmek mümkün olmak istiyorum. Herhangi bir tavsiye büyük mutluluk duyacağız.