• 08-06-2018, 13:55:59
    #1
    Üyeliği durduruldu
    Merhaba arkadaşlar sitemde bir sayfa da son yazılan yazıları gösteriyorum peki ben bunu belli bir yazar ile nasıl filitreleyebilirim mesala xxx yazarın son yazıları şeklinde...

    kullandığım kod

    <?php
    $myposts=get_posts(numberposts=-1&orderby=post_date&order=DESC');
    foreach($myposts as $post) :
    $year = mysql2date('Y-M', $post->post_date);
    if($year != $previous_year){
    echo '<li style="list-style:none;"><b>'.$year.'</b>';
    }
    echo '<li style="list-style:disc;margin-left:3em;"><b>';
    the_time('j F');
    echo '</b>: <a href="';the_permalink();echo '">';
    the_title();echo '</a></li>';
    if($year != $previous_year){echo '</li>';}
    $previous_year = $year;
    endforeach;
    ?>
    </div>
    </div>
    <?php endwhile;else : ?>
    <?php endif; ?>
  • 08-06-2018, 14:07:40
    #3
    Üyeliği durduruldu
    Alıntı
    $myposts=get_posts('author=33&numberposts=-1&orderby=post_date&order=DESC')
    ile yaptım teşekkürler