content-page.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. <?php
  2. /**
  3. * Template part for displaying pages.
  4. *
  5. * @package Dyad
  6. */
  7. ?>
  8. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  9. <?php if ( has_post_thumbnail() ) : ?>
  10. <?php
  11. $thumb = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'dyad-2-featured-image' )[0];
  12. $thumb2 = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'dyad-2-featured-image-horz' )[0];
  13. ?>
  14. <div class="entry-media" style="background-image: url(<?php echo esc_url( $thumb ); ?>)">
  15. <div class="entry-media-thumb" style="background-image: url(<?php echo esc_url( $thumb2 ); ?>); "></div>
  16. </div><!-- .entry-media -->
  17. <?php endif; ?>
  18. <div class="entry-inner">
  19. <header class="entry-header">
  20. <?php the_title( '<h1 class="entry-title">', '</h1>' ); ?>
  21. <?php edit_post_link( esc_html__( 'Edit', 'dyad-2' ), '<div class="edit-link">', '</div>' ); ?>
  22. </header><!-- .entry-header -->
  23. <div class="entry-content">
  24. <?php the_content(); ?>
  25. <?php
  26. wp_link_pages( array(
  27. 'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'dyad-2' ),
  28. 'after' => '</div>',
  29. ) );
  30. ?>
  31. </div><!-- .entry-content -->
  32. </div><!-- .entry-inner -->
  33. </article><!-- #post-## -->