content.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. /**
  3. * @package Canard
  4. */
  5. ?>
  6. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  7. <?php if ( has_post_thumbnail() && 'post' == get_post_type() && ( ! has_post_format() || has_post_format( 'image' ) || has_post_format( 'gallery' ) ) ) : ?>
  8. <?php
  9. if ( ! has_post_format() ) {
  10. echo '<a class="post-thumbnail" href="' . esc_url( get_permalink() ) . '">';
  11. } elseif ( has_post_format( 'image' ) || has_post_format( 'gallery' ) ) {
  12. echo '<div class="post-thumbnail">';
  13. }
  14. the_post_thumbnail( 'canard-post-thumbnail' );
  15. ?>
  16. <?php if ( is_sticky() ) : ?>
  17. <span class="sticky-post"><span class="genericon genericon-pinned"><span class="screen-reader-text"><?php _e( 'Sticky post', 'canard' ); ?></span></span></span>
  18. <?php endif; ?>
  19. <?php
  20. if ( ! has_post_format() ) {
  21. echo '</a>';
  22. } elseif ( has_post_format( 'image' ) || has_post_format( 'gallery' ) ) {
  23. echo '</div>';
  24. }
  25. ?>
  26. <?php endif; ?>
  27. <header class="entry-header">
  28. <?php
  29. canard_entry_categories();
  30. the_title( sprintf( '<h1 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h1>' ); ?>
  31. </header><!-- .entry-header -->
  32. <div class="entry-summary">
  33. <?php
  34. if ( strpos( $post->post_content, '<!--more' ) ) {
  35. the_content( sprintf(
  36. /* translators: %s: Name of current post. */
  37. wp_kses( __( 'Continue reading %s', 'canard' ), array( 'span' => array( 'class' => array() ) ) ),
  38. the_title( '<span class="screen-reader-text">"', '"</span>', false )
  39. ) );
  40. } else {
  41. the_excerpt();
  42. }
  43. ?>
  44. </div><!-- .entry-summary -->
  45. <?php if ( 'post' == get_post_type() ) : ?>
  46. <div class="entry-meta">
  47. <?php canard_entry_meta(); ?>
  48. </div><!-- .entry-meta -->
  49. <?php endif; ?>
  50. </article><!-- #post-## -->