content-quote.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. /**
  3. * Template part for displaying quote format posts.
  4. *
  5. * @link https://codex.wordpress.org/Template_Hierarchy
  6. *
  7. * @package Toujours
  8. */
  9. $style = '';
  10. if ( has_post_thumbnail() ) {
  11. $thumb = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'toujours-featured' );
  12. $style = 'style="background-image: url(' . esc_url( $thumb[0] ) . ');"';
  13. }
  14. ?>
  15. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?> <?php echo $style; ?>>
  16. <?php if ( is_sticky() && is_home() ) { ?>
  17. <span class="featured-post"><?php esc_html_e( 'Featured', 'toujours' ); ?></span>
  18. <?php } ?>
  19. <?php if ( '' !== $post->post_content ) { ?>
  20. <div class="entry-content">
  21. <?php
  22. the_content( sprintf(
  23. /* translators: %s: Name of current post. */
  24. wp_kses( __( 'Continue reading %s <span class="meta-nav">&rarr;</span>', 'toujours' ), array( 'span' => array( 'class' => array() ) ) ),
  25. the_title( '<span class="screen-reader-text">"', '"</span>', false )
  26. ) );
  27. ?>
  28. <?php
  29. wp_link_pages( array(
  30. 'before' => '<div class="page-links"><span class="page-links-title">' . esc_html__( 'Pages:', 'toujours' ) . '</span>',
  31. 'after' => '</div>',
  32. 'pagelink' => '<span class="page-links-num">%</span>'
  33. ) );
  34. ?>
  35. </div><!-- .entry-content -->
  36. <?php } ?>
  37. <footer class="entry-footer">
  38. <?php if ( ! is_single() ) {
  39. the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
  40. } else {
  41. the_title( '<h2 class="entry-title">', '</h2>' );
  42. } ?>
  43. <div class="entry-meta">
  44. <?php
  45. toujours_post_format();
  46. toujours_posted_on();
  47. toujours_comment_link();
  48. edit_post_link(
  49. sprintf(
  50. /* translators: %s: Name of current post */
  51. esc_html__( 'Edit %s', 'toujours' ),
  52. the_title( '<span class="screen-reader-text">"', '"</span>', false )
  53. ),
  54. '<span class="edit-link"><span class="sep">&bull;</span>','</span>'
  55. );
  56. ?>
  57. </div><!-- .entry-meta -->
  58. </footer><!-- .entry-footer -->
  59. </article><!-- #post-## -->