• Resolved Philljc

    (@philljc)


    I’m trying to include the authors name at the top of the authors page, the one you come to, to see all their posts:

    <?php get_header(); ?>
    <div id="contentwrap">
    <div id="content">
    <div class="posts">
    
    <!--Post begins -->
    <div class="post">
    <div class="postcontent">
    <div class="story">	
    
    <h2><?php echo get_the_author_link(); ?></h2>
    
                    <?php while (have_posts()) : the_post(); ?>
    <h3 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( __('Permalink to %s', 'shape'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    <?php the_excerpt(); ?>
    
    <?php endwhile; ?>
    
    </div>
    </div>
    <div class="clear"></div>
    </div>
    <!--Post ends -->
    <?php if(function_exists('wp_paginate')) { wp_paginate(); } ?>
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    Now if I put the author name in the loop.. it will, of course, repeat it for each story it generates.

    Is there a way around this? It seems to work fine for the category page.

    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
  • Have you taken a look at twentyten’s author.php template?

    It runs a secondary little loop to spit out that info, I think you could gain a lot from that

    Thread Starter Philljc

    (@philljc)

    Actually, using the contents of that entire file from TwentyTen doesn’t even return any results, I tried already to combine the two in a way and I got the same result, nothing

    Thread Starter Philljc

    (@philljc)

    Nevermind, figured it out by myself, thanks!

    <?php get_header(); ?>
    <div id="contentwrap">
    <div id="content">
    <div class="posts">
    
    <?php the_post(); ?>
    <div class="post">
    <div class="postcontent">
    <div class="story">	
    
    <h2><?php echo get_the_author_link(); ?></h2>
    
    <?php rewind_posts(); ?>
    <?php while ( have_posts() ) : the_post(); ?>
    
    <h3 class="entry-title"><a href="<?php the_permalink(); ?>" title="<?php printf( __('Permalink to %s', 'shape'), the_title_attribute('echo=0') ); ?>" rel="bookmark"><?php the_title(); ?></a></h3>
    <?php the_excerpt(); ?>
    
    <?php endwhile; ?>
    
    </div>
    </div>
    <div class="clear"></div>
    </div>
    <!--Post ends -->
    <?php if(function_exists('wp_paginate')) { wp_paginate(); } ?>
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Author name outside of loop?’ is closed to new replies.