Advertisement
Digitalraindrops

Updated Author Single.php

Apr 28th, 2011
428
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.72 KB | None | 0 0
  1. <?php
  2. /**
  3.  * The loop that displays a single post.
  4.  *
  5.  * The loop displays the posts and the post content.  See
  6.  * http://codex.wordpress.org/The_Loop to understand it and
  7.  * http://codex.wordpress.org/Template_Tags to understand
  8.  * the tags used in it.
  9.  *
  10.  * This can be overridden in child themes with loop-single.php.
  11.  *
  12.  * @package WordPress
  13.  * @subpackage Twenty_Ten
  14.  * @since Twenty Ten 1.2
  15.  */
  16. ?>
  17.  
  18. <?php
  19. //Get the Author image by Digital Raindrops  
  20. function dr_author_image( $authorid ) {
  21.     $slug = the_author_meta('user_nicename', $authorid );
  22.     if ( file_exists( get_template_directory_uri() .'/images/'.$slug.'.png' ) ) {
  23.         return get_template_directory_uri() .'/images/'.$slug.'.png); ';
  24.     }else{
  25.         return get_template_directory_uri() .'/images/auth-banner.png); ';
  26.     }
  27. }
  28. ?>
  29.  
  30. <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
  31.  
  32.     <?php
  33.         //Get author image by and the author url
  34.         $style = 'background-image: url(' .dr_author_image( $post->post_author) .');';
  35.         $link = the_author_meta( 'user_url' );
  36.     ?>
  37.    
  38.     <?php //display the author banner and add a link ?>
  39.     <div class="author-banner" style="<?php echo $style; ?>" onclick="location.href='<?php echo $link; ?>'"></div>
  40.                
  41.     <div id="nav-above" class="navigation">
  42.                     <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div>
  43.                     <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'twentyten' ) . '</span>' ); ?></div>
  44.                 </div><!-- #nav-above -->
  45.  
  46.                 <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  47.                     <h1 class="entry-title"><?php the_title(); ?></h1>
  48.  
  49.                     <div class="entry-meta">
  50.                         <?php twentyten_posted_on(); ?>
  51.                     </div><!-- .entry-meta -->
  52.                    
  53.                     <div class="entry-content">
  54.                         <?php the_content(); ?>
  55.                         <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
  56.                     </div><!-- .entry-content -->
  57.  
  58. <?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries  ?>
  59.                     <div id="entry-author-info">
  60.                         <div id="author-avatar">
  61.                             <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) ); ?>
  62.                         </div><!-- #author-avatar -->
  63.                         <div id="author-description">
  64.                             <h2><?php printf( esc_attr__( 'About %s', 'twentyten' ), get_the_author() ); ?></h2>
  65.                             <?php the_author_meta( 'description' ); ?>
  66.                             <div id="author-link">
  67.                                 <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>">
  68.                                     <?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentyten' ), get_the_author() ); ?>
  69.                                 </a>
  70.                             </div><!-- #author-link -->
  71.                         </div><!-- #author-description -->
  72.                     </div><!-- #entry-author-info -->
  73. <?php endif; ?>
  74.  
  75.                     <div class="entry-utility">
  76.                         <?php twentyten_posted_in(); ?>
  77.                         <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
  78.                     </div><!-- .entry-utility -->
  79.                 </div><!-- #post-## -->
  80.  
  81.                 <div id="nav-below" class="navigation">
  82.                     <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div>
  83.                     <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'twentyten' ) . '</span>' ); ?></div>
  84.                 </div><!-- #nav-below -->
  85.  
  86.                 <?php comments_template( '', true ); ?>
  87.  
  88. <?php endwhile; // end of the loop. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement