content-search.php 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <?php
  2. /**
  3. * Template part for displaying results in search pages.
  4. *
  5. * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  6. *
  7. * @package Pen
  8. */
  9. $pen_is_singular = is_singular();
  10. ?>
  11. <article id="post-<?php the_ID(); ?>" <?php echo pen_post_classes(); /* phpcs:ignore */ ?>>
  12. <?php
  13. $background_image_dynamic = pen_content_title_background( $pen_is_singular, get_the_ID() );
  14. ?>
  15. <header class="entry-header<?php echo pen_class_lists( 'header_display_override' ); /* phpcs:ignore */ ?>"<?php if ( $background_image_dynamic ) { echo ' style="background-image:url(' . $background_image_dynamic . ');background-size:cover"'; /* phpcs:ignore */ } ?>>
  16. <?php
  17. the_title(
  18. sprintf(
  19. '<h2 class="entry-title%1$s"><a href="%2$s" rel="bookmark">',
  20. pen_class_lists( 'title_display_override' ),
  21. esc_url( get_permalink() )
  22. ),
  23. '</a></h2>'
  24. );
  25. echo pen_html_content_information( 'header' ); /* phpcs:ignore */
  26. ?>
  27. </header><!-- .entry-header -->
  28. <?php
  29. pen_sidebar_get( 'sidebar-content-top' );
  30. $list_type = pen_option_get( 'list_type' );
  31. if ( 'masonry' === $list_type ) {
  32. get_template_part( 'partials/content', 'thumbnail' );
  33. }
  34. ?>
  35. <div class="entry-summary">
  36. <?php
  37. if ( 'plain' === $list_type ) {
  38. get_template_part( 'partials/content', 'thumbnail' );
  39. }
  40. the_excerpt();
  41. echo pen_html_author(); /* phpcs:ignore */
  42. ?>
  43. </div><!-- .entry-summary -->
  44. <?php
  45. pen_sidebar_get( 'sidebar-content-bottom' );
  46. get_template_part( 'partials/content', 'search-footer' );
  47. if ( $pen_is_singular ) {
  48. pen_html_jump_menu( 'content' );
  49. }
  50. ?>
  51. </article><!-- #post-<?php the_ID(); ?> -->