content.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * Template part for displaying posts.
  4. *
  5. * @package Pique
  6. */
  7. ?>
  8. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  9. <?php
  10. // Set the post thumbnail as the background of the panel
  11. if ( pique_has_post_thumbnail() ) :
  12. $thumbnail = pique_get_attachment_image_src( $post->ID, get_post_thumbnail_id( $post->ID ), 'pique-hero' ); ?>
  13. <div class="pique-panel-background" style="background-image:url(<?php echo esc_url( $thumbnail ); ?>)"></div>
  14. <?php endif; ?>
  15. <?php //echo get_post_format(); ?>
  16. <div class="pique-panel-content">
  17. <?php
  18. $show_title = array( 'image', 'gallery', 'audio', 'video', 'aside', 'status', 'link', 'quote' );
  19. if ( in_array( get_post_format(), $show_title ) ) :
  20. endif;
  21. ?>
  22. <header class="entry-header">
  23. <?php the_title( '<h2 class="entry-title"><a href="'. esc_url( get_the_permalink() ) .'">', '</a></h2>' ); ?>
  24. </header><!-- .entry-header -->
  25. <div class="entry-content">
  26. <?php
  27. // For certain post types, we're going to display the excerpt
  28. if ( ! get_post_format() || 'chat' === get_post_format() ) :
  29. the_excerpt();
  30. else : // Otherwise, it makes more sense to show the full content
  31. the_content();
  32. endif;
  33. ?>
  34. <div class="entry-meta">
  35. <?php pique_posted_on(); ?>
  36. </div><!-- .entry-meta -->
  37. <?php
  38. wp_link_pages( array(
  39. 'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'pique' ),
  40. 'after' => '</div>',
  41. ) );
  42. ?>
  43. </div><!-- .entry-content -->
  44. <footer class="entry-footer">
  45. <?php pique_edit_link( get_the_ID() ); ?>
  46. </footer><!-- .entry-footer -->
  47. </div><!-- .pique-panel-content -->
  48. </article><!-- #post-## -->