content-gallery.php 1.8 KB

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