Merhaba
Köşe yazıları alanı oluşturdum ancak 2 sorunum var
1- yazar siteye uye olduğunda yazısı olmasada avatarı sidebarda görünüyor.
2- Belli bir kategoriden çekmesini sağlayamadım.
Sidebar'da kullandığım kodlarım aşağıda;
Köşe yazıları alanı oluşturdum ancak 2 sorunum var
1- yazar siteye uye olduğunda yazısı olmasada avatarı sidebarda görünüyor.
2- Belli bir kategoriden çekmesini sağlayamadım.
Sidebar'da kullandığım kodlarım aşağıda;
Kod:
<?php
//displays all users with their avatar and their posts (titles)
$blogusers = get_users_of_blog();
if ($blogusers) {
foreach ($blogusers as $bloguser) {
$user = get_userdata($bloguser->user_id);
$args=array(
'author' => $user->ID,
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => 1,
'caller_get_posts'=> 1,
); ?>
<li>
<div style="float:left; margin-right:8px; vertical-align:top;"><?php echo get_avatar( $user->ID, 64 ); ?> </div>
<?php
$my_query = lisanssız;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
//echo 'List of Posts for ' . user->user_firstname . ' ' . $user->user_lastname;
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<span style="color:#900; font-weight:bold;"> <?php echo ' ' . $user->user_firstname . ' ' . $user->user_lastname ; ?> </span>
<span style="margin-top:8px; font-weight:normal; font-size:12px; color:#004b6f;"><a href="<?php the_permalink() ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></span>
</li>
<?php
endwhile;
}
wp_reset_query(); // Restore global post data stomped by the_post().
}
}