[ 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://codex.wordpress.org/The_Loop to understand it and
   7   * https://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  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                              echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentyten_author_bio_avatar_size', 60 ) );
  54                              ?>
  55                              </div><!-- #author-avatar -->
  56                              <div id="author-description">
  57                              <h2>
  58                              <?php
  59                              /* translators: %s: author display name */
  60                              printf( __( 'About %s', 'twentyten' ), get_the_author() );
  61                              ?>
  62                              </h2>
  63                              <?php the_author_meta( 'description' ); ?>
  64                              <div id="author-link">
  65                                  <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
  66                                      <?php
  67                                      /* translators: %s: author display name */
  68                                      printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentyten' ), get_the_author() );
  69                                      ?>
  70                                  </a>
  71                              </div><!-- #author-link    -->
  72                              </div><!-- #author-description -->
  73                          </div><!-- #entry-author-info -->
  74      <?php endif; ?>
  75  
  76                          <div class="entry-utility">
  77                              <?php twentyten_posted_in(); ?>
  78                              <?php edit_post_link( __( 'Edit', 'twentyten' ), '<span class="edit-link">', '</span>' ); ?>
  79                          </div><!-- .entry-utility -->
  80                      </div><!-- #post-<?php the_ID(); ?> -->
  81  
  82                      <div id="nav-below" class="navigation">
  83                          <div class="nav-previous"><?php previous_post_link( '%link', '<span class="meta-nav">' . _x( '&larr;', 'Previous post link', 'twentyten' ) . '</span> %title' ); ?></div>
  84                          <div class="nav-next"><?php next_post_link( '%link', '%title <span class="meta-nav">' . _x( '&rarr;', 'Next post link', 'twentyten' ) . '</span>' ); ?></div>
  85                      </div><!-- #nav-below -->
  86  
  87                      <?php comments_template( '', true ); ?>
  88  
  89      <?php endwhile;
  90  }; // end of the loop. ?>


Generated: Sun Jul 21 01:00:03 2019 Cross-referenced by PHPXref 0.7.1