• Resolved callender

    (@jimcallender)


    Hi there,

    I am trying to find the code to insert a link to the authors page,

    <a href="link to authors page">author name</a>

    Currently i am using:

    <h2><?php the_author_meta('display_name', $author->post_author); ?></h2>

    but it doesn’t include a link to the authors page?

    can you help?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Check out the codex on Author templates: https://codex.www.ads-software.com/Author_Templates

    Thread Starter callender

    (@jimcallender)

    Hi LonelySchnozz,

    Thanks, however as well as the author link i also need an avatar with each author and latest post..

    currently:

    <?php  $authors = $wpdb->get_results('SELECT DISTINCT post_author FROM '.$wpdb->posts);
    		if($authors): foreach($authors as $author): ?>
    
    		  <div class="left">
    				<h2><?php the_author_meta('display_name', $author->post_author); ?></h2>
    				<?php echo get_avatar(get_the_author_meta('user_email', $author->post_author), 200); ?>
    			  <?php endif; ?>
    			</div>
    
    			<?php $recentPost = new WP_Query('author='.$author->post_author.'&showposts=1'); while($recentPost->have_posts()): $recentPost->the_post(); ?>
    
    			<div class="right">
    			<h2 class="entry-title"> <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a>  </h2>
    			 <?php the_excerpt(); ?> 
    
    			 <p class="postmetadata">Posted on <?php the_time('jS F Y') ?></p>
    			 <h3><a href='<?php the_title();?>'><?php the_title(); ?> > </a></h3>
    			 <p class="postmetadata"><?php the_time('jS F Y') ?></p>
    			 <p><a href="<?php the_permalink() ?>" rel="bookmark" class="more-link-writer">Read more by <?php the_author_meta( 'nickname' ); ?></a></p>

    but i’m thinking this may be overkill, coudl you provide a way of building up your suggestion?

    currently i’ve started with:

    <h2><?php wp_list_authors('exclude_admin=1&hide_empty=1'); ?>
    </h2>

    many thanks for any help!

    Thread Starter callender

    (@jimcallender)

    <>Read more by <?php the_author_posts_link(); ?></p>

    Also this works – linking to the author page.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Get link of author page?’ is closed to new replies.