Displaying author information on single.php
-
Hi there
I already have author.php setup, however, I want to display some author information over on the right hand side of my single.php file.
Please checkout my code below….
<?php get_header(); ?> <div id="content"> <?php if(isset($_GET['author_name'])) : $curauth = get_userdatabylogin($author_name); else : $curauth = get_userdata(intval($author)); endif; ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="post" id="post-<?php the_ID(); ?>"> <h2 class="title"><?php the_title(); ?></h2> <div id="stats"> <span><?php the_time('j F Y') ?> | <span><?php comments_number('No Comments', '1 Comment', '% Comments' );?></span></div> <div id="stats"><span>PUBLISHED BY: <a href="<?php the_author_meta('user_url'); ?>"><?php the_author_meta('aim'); ?></a></span></div> <div class="entry clearfloat"> <?php the_content('Read the rest of this entry »'); ?> <?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?> </div> <div id="tools"> <div style="float:left;"><a href=" http://digg.com/submit?phase=2&url= <?php the_permalink();?>&title=<?php the_title();?>" target="_blank"><img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/sociable/digg.png" title="Digg this!"></a><a href=" http://del.icio.us/post?v=4&noui&jump=close &url=<?php the_permalink();?> &title=<?php the_title();?>" target="_blank"><img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/sociable/delicious.png" title="Add to del.icio.us!"></a><a href="http://www.stumbleupon.com/submit?url=<?php the_permalink(); ?>&title=<?php the_title(); ?>" target="_blank"><img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/sociable/stumbleupon.png" title="Stumble this!"></a><a href=" http://technorati.com/faves?add=<?php echo get_option('home'); ?>" target="_blank"><img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/sociable/technorati.png" title="Add to Techorati!"></a><a href="http://www.facebook.com/sharer.php?u=<?php the_permalink();?>&t=<?php the_title();?>" target="_blank"><img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/sociable/facebook.png" title="Share on Facebook!"></a><a href=" http://www.newsvine.com/_tools/seed&save? u=<?php the_permalink();?>&h=<?php the_title();?>" target="_blank"><img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/sociable/newsvine.png" title="Seed Newsvine!"></a><a href=" http://reddit.com/submit?url= <?php the_permalink();?>&title=<?php the_title();?>" target="_blank"><img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/sociable/reddit.png" title="Reddit!"></a><a href=" http://myweb.yahoo.com/myresults/bookmarklet? t=<?php the_title();?>&u=<?php the_permalink();?>&ei=UTF" target="_blank"><img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/sociable/yahoomyweb.png" title="Add to Yahoo!"></a> </div> <div style="float:right;display:block;"><?php if(function_exists('the_ratings')) { the_ratings(); } ?></div> </div> </div> <div id="comments"> <?php comments_template(); ?> </div> <?php endwhile; else: ?> <p>Sorry, no posts matched your criteria.</p> <?php endif; ?> </div> <div id="bloginfo"> <div h2 class="title"><?php echo $curauth->nickname; ?> </div> <div class="right"> <?php global $authordata; $authordata=get_userdata(get_query_var( 'author' )); userphoto_the_author_photo(); ?> </div> <?php echo $curauth->user_description; ?> <p><strong>Email:</strong> <?php the_author_meta('yim'); ?></p> </div> <?php get_sidebar(); ?> <?php get_footer(); ?>This code at the bottom works on my author.php just not on the single.php
Any ideas on how I can resolve?
Many thanks in advance.
Adam
The topic ‘Displaying author information on single.php’ is closed to new replies.