• 21-01-2016, 19:30:51
    #1
    Arkadaş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?

    <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>
  • 24-01-2016, 21:11:52
    #2
    Yokmu bilen?
  • 24-01-2016, 21:17:50
    #3
    Kimlik doğrulama veya yönetimden onay bekliyor.
    get_posts( array( 'post__not_in' => get_option( 'sticky_posts' ), 'posts_per_page' => 10, 'orderby' => 'post_date, 'order' => 'DESC' ) );

    kodu böyle yazarsanız çalışması lazım..
  • 24-01-2016, 21:39:43
    #4
    sakarya adlı üyeden alıntı: mesajı görüntüle
    get_posts( array( 'post__not_in' => get_option( 'sticky_posts' ), 'posts_per_page' => 10, 'orderby' => 'post_date, 'order' => 'DESC' ) );

    kodu böyle yazarsanız çalışması lazım..
    Sagolun hocam
  • 25-01-2016, 18:06:43
    #5
    <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:41
    #6
    sakarya adlı üyeden alıntı: mesajı görüntüle
    <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>
    hocam böyle bir hata verdi hocam

    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:31:06
    #7
    Konu güncel arkadaşlar kodu düzgün birşekilde yazabilecek olan varmı? Sticky postları almadan son 10 yazıyı göstermek istiyorum sidebarda.
  • 12-02-2016, 13:33:39
    #8
    <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:04
    #9
    Kemal AKIN adlı üyeden alıntı: mesajı görüntüle
    <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
    Hocam 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.