content.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * Template part for displaying posts.
  4. *
  5. * @link https://codex.wordpress.org/Template_Hierarchy
  6. *
  7. * @package Scratchpad
  8. */
  9. ?>
  10. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  11. <?php scratchpad_sticky(); ?>
  12. <?php if ( has_post_thumbnail() ) { ?>
  13. <div class="featured-image">
  14. <a href="<?php the_permalink(); ?>">
  15. <?php get_template_part( 'images/inline', 'paperclip.svg' ); ?>
  16. <?php the_post_thumbnail( 'scratchpad-featured' ); ?>
  17. </a>
  18. </div><!-- .featured-image -->
  19. <?php } ?>
  20. <header class="entry-header">
  21. <?php scratchpad_categories(); ?>
  22. <?php
  23. if ( is_single() ) {
  24. the_title( '<h1 class="entry-title">', '</h1>' );
  25. } else {
  26. the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
  27. }
  28. if ( 'post' === get_post_type() ) : ?>
  29. <div class="entry-meta">
  30. <?php scratchpad_posted_on(); ?>
  31. <?php
  32. edit_post_link(
  33. sprintf(
  34. /* translators: %s: Name of current post */
  35. esc_html__( 'Edit %s', 'scratchpad' ),
  36. the_title( '<span class="screen-reader-text">"', '"</span>', false )
  37. ),
  38. '<span class="edit-link"><span class="sep">&bull;</span>',
  39. '</span>'
  40. );
  41. ?>
  42. </div><!-- .entry-meta -->
  43. <?php
  44. endif; ?>
  45. </header><!-- .entry-header -->
  46. <div class="entry-content">
  47. <?php
  48. the_content( sprintf(
  49. /* translators: %s: Name of current post. */
  50. wp_kses( __( 'Continue reading %s <span class="meta-nav">&rarr;</span>', 'scratchpad' ), array( 'span' => array( 'class' => array() ) ) ),
  51. the_title( '<span class="screen-reader-text">"', '"</span>', false )
  52. ) );
  53. wp_link_pages( array(
  54. 'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'scratchpad' ),
  55. 'after' => '</div>',
  56. 'link_before' => '<span>',
  57. 'link_after' => '</span>',
  58. ) );
  59. ?>
  60. </div><!-- .entry-content -->
  61. </article><!-- #post-## -->