Arkadaşlar merhaba,
Aşağıda verdiğim kodların çıktısı aşağıda ki resim gibidir:
<div class="side-author">
<?php
// Get the authors from the database ordered by user nicename
global $wpdb;
$site_admin = ""; // enter Admin ID to exclude
$query = "SELECT ID, user_nicename from $wpdb->users WHERE ID != '$site_admin' ORDER BY user_nicename";
$author_ids = $wpdb->get_results($query);
// Loop through each author
foreach($author_ids as $author) :
// Get user data
$curauth = get_userdata($author->ID);
// Get link to author page
$user_link = get_author_posts_url($curauth->ID);
?>
<ul>
<?php $author_query = new WP_Query( 'author='.$curauth->ID.'&posts_per_page=-1&showposts=1' );
while ( $author_query->have_posts() ) : $author_query->the_post(); ?>
<div class="author-images"><?php echo get_avatar(get_the_author_meta('user_email'),'50'); ?></div>
<li class="author-nick"><?php echo $curauth->nickname; ?></li>
<li class="author-aciklama"><?php the_author_meta('description'); ?></li>
<li class="author-yazi"> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>
<?php endwhile; wp_reset_postdata(); ?></li>
</ul>
<?php endforeach; ?>
</div>Ben istiyorum ki 5 adet yazar bu şekilde listelensin.
Ve yebi bir yazı ekleyen yazar sıralama da en üst tarafa güncellensin. Sıralama bu şekilde devam etsin.
Şİmdi ki halinde yazarları ve en son yazılarını görebiliyoruz fakat yeni bir yazı eklendiğinde yazarın sırası değişmiyor nerede ise orada kalyıor.
Yardımcı olabilir misiniz?