Blog in Blog Problem: Authors Post Link
I’ve made a small hack for my sidebar in order to show the recent 3 posts under my cathegory-links with a small loop outside the Loop:
$posts = get_posts('numberposts=3&offset=0');
foreach ($posts as $post) :
<h3><a href="<?php the_permalink(); ?>"><?php the_title() ?></a></h3>
<p><?php the_excerpt() ?></p>
<div><?php the_time('d.m.Y H:i'); ?> | <?php the_author_posts_link('nickname'); ?> <?php comments_number('| 0','| 1','| %'); ?> | <a href="<?php the_permalink(); ?>">more</a></div>
<?php endforeach; ?>
Of course the_author_posts_link does not work correctly, because it always is relating to the “Main-Loop”. Do I have any chance to show the author relating to the post-excerpt inside this second loop?
- The topic ‘Blog in Blog Problem: Authors Post Link’ is closed to new replies.