PageRenderTime 58ms CodeModel.GetById 23ms RepoModel.GetById 0ms app.codeStats 0ms

/wp-content/themes/twentyten/loop-single.php

https://github.com/davodey/WordPress
PHP | 70 lines | 45 code | 10 blank | 15 comment | 3 complexity | 38a4f643f8926bc7f3850b7f0c2c210c MD5 | raw file
Possible License(s): GPL-2.0, AGPL-1.0, LGPL-2.1
  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. <?php if ( have_posts() ) while ( have_posts() ) : the_post(); ?>
  18. <div id="nav-above" class="navigation">
  19. <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div>
  20. <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'twentyten' ) . '</span>' ); ?></div>
  21. </div><!-- #nav-above -->
  22. <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  23. <h1 class="entry-title"><?php the_title(); ?></h1>
  24. <div class="entry-meta">
  25. <?php twentyten_posted_on(); ?>
  26. </div><!-- .entry-meta -->
  27. <div class="entry-content">
  28. <?php the_content(); ?>
  29. <?php wp_link_pages( array( 'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ), 'after' => '</div>' ) ); ?>
  30. </div><!-- .entry-content -->
  31. <?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries ?>
  32. <div id="entry-author-info">
  33. <div id="author-avatar">
  34. <?php
  35. /** This filter is documented in author.php */
  36. echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) );
  37. ?>
  38. </div><!-- #author-avatar -->
  39. <div id="author-description">
  40. <h2><?php printf( __( 'About %s', 'twentyten' ), get_the_author() ); ?></h2>
  41. <?php the_author_meta( 'description' ); ?>
  42. <div id="author-link">
  43. <a href="<?php echo get_author_posts_url( get_the_author_meta( 'ID' ) ); ?>" rel="author">
  44. <?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentyten' ), get_the_author() ); ?>
  45. </a>
  46. </div><!-- #author-link -->
  47. </div><!-- #author-description -->
  48. </div><!-- #entry-author-info -->
  49. <?php endif; ?>
  50. <div class="entry-utility">
  51. <?php twentyten_posted_in(); ?>
  52. <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
  53. </div><!-- .entry-utility -->
  54. </div><!-- #post-## -->
  55. <div id="nav-below" class="navigation">
  56. <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div>
  57. <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'twentyten' ) . '</span>' ); ?></div>
  58. </div><!-- #nav-below -->
  59. <?php comments_template( '', true ); ?>
  60. <?php endwhile; // end of the loop. ?>