PageRenderTime 41ms CodeModel.GetById 18ms RepoModel.GetById 1ms app.codeStats 0ms

/wp-content/themes/twentytwelve/content.php

https://bitbucket.org/abnopanda/wordpress
PHP | 64 lines | 54 code | 3 blank | 7 comment | 11 complexity | f5383a24849386a17b86c638fc9a1f1d MD5 | raw file
  1. <?php
  2. /**
  3. * The default template for displaying content. Used for both single and index/archive/search.
  4. *
  5. * @package WordPress
  6. * @subpackage Twenty_Twelve
  7. * @since Twenty Twelve 1.0
  8. */
  9. ?>
  10. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  11. <?php if ( is_sticky() && is_home() && ! is_paged() ) : ?>
  12. <div class="featured-post">
  13. <?php _e( 'Featured post', 'twentytwelve' ); ?>
  14. </div>
  15. <?php endif; ?>
  16. <header class="entry-header">
  17. <?php the_post_thumbnail(); ?>
  18. <?php if ( is_single() ) : ?>
  19. <h1 class="entry-title"><?php the_title(); ?></h1>
  20. <?php else : ?>
  21. <h1 class="entry-title">
  22. <a href="<?php the_permalink(); ?>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'twentytwelve' ), the_title_attribute( 'echo=0' ) ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
  23. </h1>
  24. <?php endif; // is_single() ?>
  25. <?php if ( comments_open() ) : ?>
  26. <div class="comments-link">
  27. <?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'twentytwelve' ) . '</span>', __( '1 Reply', 'twentytwelve' ), __( '% Replies', 'twentytwelve' ) ); ?>
  28. </div><!-- .comments-link -->
  29. <?php endif; // comments_open() ?>
  30. </header><!-- .entry-header -->
  31. <?php if ( is_search() ) : // Only display Excerpts for Search ?>
  32. <div class="entry-summary">
  33. <?php the_excerpt(); ?>
  34. </div><!-- .entry-summary -->
  35. <?php else : ?>
  36. <div class="entry-content">
  37. <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentytwelve' ) ); ?>
  38. <?php wp_link_pages( array( 'before' => '<div class="page-links">' . __( 'Pages:', 'twentytwelve' ), 'after' => '</div>' ) ); ?>
  39. </div><!-- .entry-content -->
  40. <?php endif; ?>
  41. <footer class="entry-meta">
  42. <?php twentytwelve_entry_meta(); ?>
  43. <?php edit_post_link( __( 'Edit', 'twentytwelve' ), '<span class="edit-link">', '</span>' ); ?>
  44. <?php if ( is_singular() && get_the_author_meta( 'description' ) && is_multi_author() ) : // If a user has filled out their description and this is a multi-author blog, show a bio on their entries. ?>
  45. <div class="author-info">
  46. <div class="author-avatar">
  47. <?php echo get_avatar( get_the_author_meta( 'user_email' ), apply_filters( 'twentytwelve_author_bio_avatar_size', 68 ) ); ?>
  48. </div><!-- .author-avatar -->
  49. <div class="author-description">
  50. <h2><?php printf( __( 'About %s', 'twentytwelve' ), get_the_author() ); ?></h2>
  51. <p><?php the_author_meta( 'description' ); ?></p>
  52. <div class="author-link">
  53. <a href="<?php echo esc_url( get_author_posts_url( get_the_author_meta( 'ID' ) ) ); ?>" rel="author">
  54. <?php printf( __( 'View all posts by %s <span class="meta-nav">&rarr;</span>', 'twentytwelve' ), get_the_author() ); ?>
  55. </a>
  56. </div><!-- .author-link -->
  57. </div><!-- .author-description -->
  58. </div><!-- .author-info -->
  59. <?php endif; ?>
  60. </footer><!-- .entry-meta -->
  61. </article><!-- #post -->