content-gallery.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /**
  3. * Template part for displaying gallery 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
  13. if ( ! post_password_required() ) { ?>
  14. <div class="entry-gallery">
  15. <?php
  16. if ( get_post_gallery() ) {
  17. echo get_post_gallery();
  18. } else {
  19. echo the_content();
  20. }
  21. ?>
  22. <div class="photo-corners">
  23. <?php
  24. get_template_part( 'images/inline', 'photo-corners.svg' );
  25. get_template_part( 'images/inline', 'photo-corners.svg' );
  26. get_template_part( 'images/inline', 'photo-corners.svg' );
  27. get_template_part( 'images/inline', 'photo-corners.svg' );
  28. ?>
  29. </div><!-- .photo-corners -->
  30. </div><!-- .entry-gallery -->
  31. <?php
  32. } // endif get_post_gallery()
  33. ?>
  34. <header class="entry-header">
  35. <?php if ( ! is_single() ) {
  36. the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' );
  37. } else {
  38. the_title( '<h2 class="entry-title">', '</h2>' );
  39. } ?>
  40. </header><!-- .entry-header -->
  41. <footer class="entry-meta">
  42. <?php scratchpad_post_format(); ?>
  43. <?php scratchpad_posted_on(); ?>
  44. <?php
  45. edit_post_link(
  46. sprintf(
  47. /* translators: %s: Name of current post */
  48. esc_html__( 'Edit %s', 'scratchpad' ),
  49. the_title( '<span class="screen-reader-text">"', '"</span>', false )
  50. ),
  51. '<span class="edit-link"><span class="sep">&bull;</span>',
  52. '</span>'
  53. );
  54. ?>
  55. </footer><!-- .entry-footer -->
  56. <?php
  57. if ( post_password_required() ) {
  58. the_content();
  59. } ?>
  60. </article><!-- #post-## -->