暫無描述

content-search.php 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 XShop
  8. */
  9. $xshop_blog_style = get_theme_mod( 'xshop_blog_style', 'grid' );
  10. if( $xshop_blog_style == 'grid' ):
  11. get_template_part( 'template-parts/content', 'grid' );
  12. else:
  13. ?>
  14. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  15. <div class="xpost-item shadow pb-5 mb-5">
  16. <?php xshop_post_thumbnail(); ?>
  17. <div class="xpost-text p-3">
  18. <header class="entry-header text-center pb-4">
  19. <?php
  20. if ( is_singular() ) :
  21. the_title( '<h1 class="entry-title">', '</h1>' );
  22. else :
  23. the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
  24. endif;
  25. if ( 'post' === get_post_type() ) :
  26. ?>
  27. <div class="entry-meta">
  28. <?php
  29. xshop_posted_on();
  30. xshop_posted_by();
  31. ?>
  32. </div><!-- .entry-meta -->
  33. <?php endif; ?>
  34. </header><!-- .entry-header -->
  35. <div class="entry-content">
  36. <?php
  37. the_excerpt( );
  38. ?>
  39. </div><!-- .entry-content -->
  40. <footer class="entry-footer">
  41. <?php xshop_entry_footer(); ?>
  42. </footer><!-- .entry-footer -->
  43. </div>
  44. </div>
  45. </article><!-- #post-<?php the_ID(); ?> -->
  46. <?php endif; ?>