content.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /**
  3. * The default template for displaying content
  4. *
  5. * Used for both single and index/archive/search.
  6. *
  7. * @package WordPress
  8. * @subpackage Twenty_Fourteen
  9. * @since Twenty Fourteen 1.0
  10. */
  11. ?>
  12. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  13. <?php twentyfourteen_post_thumbnail(); ?>
  14. <header class="entry-header">
  15. <?php if ( in_array( 'category', get_object_taxonomies( get_post_type() ) ) && twentyfourteen_categorized_blog() ) : ?>
  16. <div class="entry-meta">
  17. <span class="cat-links"><?php echo get_the_category_list( _x( ', ', 'Used between list items, there is a space after the comma.', 'twentyfourteen' ) ); ?></span>
  18. </div>
  19. <?php
  20. endif;
  21. if ( is_single() ) :
  22. the_title( '<h1 class="entry-title">', '</h1>' );
  23. else :
  24. the_title( '<h1 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h1>' );
  25. endif;
  26. ?>
  27. <div class="entry-meta">
  28. <?php
  29. if ( 'post' == get_post_type() )
  30. twentyfourteen_posted_on();
  31. if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) :
  32. ?>
  33. <span class="comments-link"><?php comments_popup_link( __( 'Leave a comment', 'twentyfourteen' ), __( '1 Comment', 'twentyfourteen' ), __( '% Comments', 'twentyfourteen' ) ); ?></span>
  34. <?php
  35. endif;
  36. edit_post_link( __( 'Edit', 'twentyfourteen' ), '<span class="edit-link">', '</span>' );
  37. ?>
  38. </div><!-- .entry-meta -->
  39. </header><!-- .entry-header -->
  40. <?php if ( is_search() ) : ?>
  41. <div class="entry-summary">
  42. <?php the_excerpt(); ?>
  43. </div><!-- .entry-summary -->
  44. <?php else : ?>
  45. <div class="entry-content">
  46. <?php
  47. /* translators: %s: Name of current post */
  48. the_content( sprintf(
  49. __( 'Continue reading %s <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ),
  50. the_title( '<span class="screen-reader-text">', '</span>', false )
  51. ) );
  52. wp_link_pages( array(
  53. 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
  54. 'after' => '</div>',
  55. 'link_before' => '<span>',
  56. 'link_after' => '</span>',
  57. ) );
  58. ?>
  59. </div><!-- .entry-content -->
  60. <?php endif; ?>
  61. <?php the_tags( '<footer class="entry-meta"><span class="tag-links">', '', '</span></footer>' ); ?>
  62. </article><!-- #post-## -->