No Description

content.php 1.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /**
  3. * Template part for displaying posts
  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' && !is_single() ):
  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. if(is_single()){
  38. the_content(
  39. sprintf(
  40. wp_kses(
  41. /* translators: %s: Name of current post. Only visible to screen readers */
  42. __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'xshop' ),
  43. array(
  44. 'span' => array(
  45. 'class' => array(),
  46. ),
  47. )
  48. ),
  49. wp_kses_post( get_the_title() )
  50. )
  51. );
  52. wp_link_pages(
  53. array(
  54. 'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'xshop' ),
  55. 'after' => '</div>',
  56. )
  57. );
  58. }else{
  59. the_excerpt( );
  60. }
  61. ?>
  62. </div><!-- .entry-content -->
  63. <footer class="entry-footer">
  64. <?php xshop_entry_footer(); ?>
  65. </footer><!-- .entry-footer -->
  66. </div>
  67. </div>
  68. </article><!-- #post-<?php the_ID(); ?> -->
  69. <?php endif; ?>