content-search.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Template part for displaying results in search pages.
  4. *
  5. * @link https://codex.wordpress.org/Template_Hierarchy
  6. *
  7. * @package Dara
  8. */
  9. ?>
  10. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  11. <?php if ( has_post_thumbnail() && 'post' !== get_post_type() ||
  12. dara_has_post_thumbnail() && 'post' === get_post_type() ) : ?>
  13. <div class="post-thumbnail">
  14. <a href="<?php the_permalink(); ?>">
  15. <?php the_post_thumbnail( 'dara-featured-image' ); ?>
  16. </a>
  17. </div>
  18. <?php endif; ?>
  19. <header class="entry-header">
  20. <?php
  21. // Hide category and tag text for pages.
  22. if ( 'post' === get_post_type() ) {
  23. /* translators: used between list items, there is a space after the comma */
  24. $categories_list = get_the_category_list( ', ' );
  25. if ( $categories_list && dara_categorized_blog() ) {
  26. printf( '<span class="cat-links">%1$s</span>', $categories_list );
  27. }
  28. }
  29. the_title( sprintf( '<h2 class="entry-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h2>' ); ?>
  30. </header>
  31. <div class="entry-body">
  32. <?php if ( 'post' === get_post_type() ) : ?>
  33. <?php get_template_part( 'components/post/content', 'meta' ); ?>
  34. <?php endif; ?>
  35. <div class="entry-summary">
  36. <?php the_excerpt(); ?>
  37. </div>
  38. <?php get_template_part( 'components/post/content', 'footer' ); ?>
  39. </div>
  40. </article>