[ Index ]

PHP Cross Reference of WordPress

title

Body

[close]

/wp-content/themes/twentyten/ -> loop-single.php (source)

   1  <?php
   2  /**
   3   * The loop that displays a single post
   4   *
   5   * The loop displays the posts and the post content. See
   6   * https://developer.wordpress.org/themes/basics/the-loop/ to understand it and
   7   * https://developer.wordpress.org/themes/basics/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  if ( have_posts() ) {
  20      while ( have_posts() ) :
  21          the_post();
  22          ?>
  23  
  24                  <div id="nav-above" class="navigation">
  25                      <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div>
  26                      <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'twentyten' ) . '</span>' ); ?></div>
  27                  </div><!-- #nav-above -->
  28  
  29                  <div id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  30                      <h1 class="entry-title"><?php the_title(); ?></h1>
  31  
  32                      <div class="entry-meta">
  33                          <?php twentyten_posted_on(); ?>
  34                      </div><!-- .entry-meta -->
  35  
  36                      <div class="entry-content">
  37                          <?php the_content(); ?>
  38                          <?php
  39                          wp_link_pages(
  40                              array(
  41                                  'before' => '<div class="page-link">' . __( 'Pages:', 'twentyten' ),
  42                                  'after'  => '</div>',
  43                              )
  44                          );
  45                          ?>
  46                      </div><!-- .entry-content -->
  47  
  48          <?php if ( get_the_author_meta( 'description' ) ) : // If a user has filled out their description, show a bio on their entries. ?>
  49                      <div id="entry-author-info">
  50                          <div id="author-avatar">
  51                              <?php
  52                              /** This filter is documented in author.php */
  53                              $author_bio_avatar_size = apply_filters( 'twentyten_author_bio_avatar_size', 60 );
  54                              echo get_avatar( get_the_author_meta( 'user_email' ), $author_bio_avatar_size );
  55                              ?>
  56                              </div><!-- #author-avatar -->
  57                              <div id="author-description">
  58                              <h2>
  59                              <?php
  60                              /* translators: %s: Author display name. */
  61                              printf( __( 'About %s', 'twentyten' ), get_the_author() );
  62                              ?>
  63                              </h2>
  64                              <?php the_author_meta( 'description' ); ?>
  65                              <div id="author-link">
  66                                  <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
  67                                      <?php
  68                                      /* translators: %s: Author display name. */
  69                                      printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentyten' ), get_the_author() );
  70                                      ?>
  71                                  </a>
  72                              </div><!-- #author-link    -->
  73                              </div><!-- #author-description -->
  74                          </div><!-- #entry-author-info -->
  75      <?php endif; ?>
  76  
  77                          <div class="entry-utility">
  78                              <?php twentyten_posted_in(); ?>
  79                              <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
  80                          </div><!-- .entry-utility -->
  81                      </div><!-- #post-<?php the_ID(); ?> -->
  82  
  83                      <div id="nav-below" class="navigation">
  84                          <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div>
  85                          <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'twentyten' ) . '</span>' ); ?></div>
  86                      </div><!-- #nav-below -->
  87  
  88                      <?php comments_template( '', true ); ?>
  89  
  90      <?php endwhile;
  91  } // End of the loop. ?>


Generated: Fri Apr 19 01:00:02 2024 Cross-referenced by PHPXref 0.7.1