<ul><?php $posts=get_posts("numberposts=10&orderby=post_date&order=DESC"); foreach($posts as $post) : ?><li><a href=""><?php the_title(); ?></a></li><?php endforeach; ?></ul> Wordpress Son Yazıları Kodla Gösterme
10
●770
- 21-01-2016, 19:30:51Arkadaşlar bu kod sorunsuz çalışıyor ama benim sitemde 10 tane sabit post var ve son yazı olarak bunları gösteriyor. Gerçekten son yayınlayan yazıları göstermem için kodda nereyi değişmem gerekiyor?
- 25-01-2016, 18:06:43
<ul><?php $posts=get_posts( array( 'post__not_in' => get_option( 'sticky_posts' ), 'posts_per_page' => 10, 'orderby' => 'post_date, 'order' => 'DESC' ) ); foreach($posts as $post) : ?><li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li><?php endforeach; ?></ul>
- 25-01-2016, 19:15:41hocam böyle bir hata verdi hocamsakarya adlı üyeden alıntı: mesajı görüntüle
Parse error: syntax error, unexpected 'order' (T_STRING), expecting ')' in public_html/wp-content/themes/beyaz/sidebar.php on line 92 - 12-02-2016, 13:33:39
<ul> <?php $recent_posts = wp_get_recent_posts(); foreach( $recent_posts as $recent ){ echo '<li><a href="' . get_permalink($recent["ID"]) . '">' . $recent["post_title"].'</a> </li> '; } ?> </ul>Kaynak https://codex.wordpress.org/Function...t_recent_posts - 12-02-2016, 13:44:04Hocam bu kodda hata verdi not defterine yazıp bi yeremi yükleseniz acaba buraya kopyalayıncamı bozuluyor anlamadım. Kod yapısında hata var çalışmıyor.Kemal AKIN adlı üyeden alıntı: mesajı görüntüle