content.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * @package Penscratch 2
  4. */
  5. ?>
  6. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  7. <header class="entry-header">
  8. <?php the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' ); ?>
  9. </header><!-- .entry-header -->
  10. <?php if ( penscratch_2_has_post_thumbnail() ) : ?>
  11. <div class="entry-thumbnail">
  12. <a href="<?php the_permalink(); ?>"><?php the_post_thumbnail( 'penscratch-2-featured' ); ?></a>
  13. </div>
  14. <?php endif; ?>
  15. <?php if ( 'post' == get_post_type() ) : ?>
  16. <div class="entry-meta">
  17. <?php penscratch_2_posted_on(); ?>
  18. <?php if ( ! post_password_required() && ( comments_open() || get_comments_number() ) ) {
  19. echo '<span class="sep"> ~ </span><span class="comments-link">';
  20. comments_popup_link( esc_html__( 'Leave a comment', 'penscratch-2' ), esc_html__( '1 Comment', 'penscratch-2' ), esc_html__( '% Comments', 'penscratch-2' ) );
  21. echo '</span>';
  22. } ?>
  23. <?php edit_post_link(
  24. sprintf(
  25. /* translators: %s: Name of current post */
  26. esc_html__( 'Edit %s', 'penscratch-2' ),
  27. the_title( '<span class="screen-reader-text">"', '"</span>', false )
  28. ),
  29. '<span class="edit-link"><span class="sep"> ~ </span>',
  30. '</span>'
  31. ); ?>
  32. </div><!-- .entry-meta -->
  33. <?php endif; ?>
  34. <?php if ( is_search() ) : // Only display Excerpts for Search ?>
  35. <div class="entry-summary">
  36. <?php the_excerpt(); ?>
  37. </div><!-- .entry-summary -->
  38. <?php else : ?>
  39. <div class="entry-content">
  40. <?php the_content( sprintf(
  41. /* translators: %s: Name of current post. */
  42. wp_kses( __( 'Continue reading %s <span class="meta-nav">&rarr;</span>', 'penscratch-2' ), array( 'span' => array( 'class' => array() ) ) ),
  43. the_title( '<span class="screen-reader-text">"', '"</span>', false )
  44. ) ); ?>
  45. <?php
  46. wp_link_pages( array(
  47. 'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'penscratch-2' ),
  48. 'after' => '</div>',
  49. ) );
  50. ?>
  51. </div><!-- .entry-content -->
  52. <?php endif; ?>
  53. </article><!-- #post-## -->