content.php 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'twentyfourteen' ) );
  48. wp_link_pages( array(
  49. 'before' => '<div class="page-links"><span class="page-links-title">' . __( 'Pages:', 'twentyfourteen' ) . '</span>',
  50. 'after' => '</div>',
  51. 'link_before' => '<span>',
  52. 'link_after' => '</span>',
  53. ) );
  54. ?>
  55. </div><!-- .entry-content -->
  56. <?php endif; ?>
  57. <?php the_tags( '<footer class="entry-meta"><span class="tag-links">', '', '</span></footer>' ); ?>
  58. </article><!-- #post-## -->