No Description

content.php 2.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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_lite_blog_style = get_theme_mod( 'xshop_lite_blog_style', 'list' );
  10. if( $xshop_lite_blog_style == 'list' && !is_single() ):
  11. get_template_part( 'template-parts/content', 'list' );
  12. elseif( $xshop_lite_blog_style == 'grid' && !is_single() ):
  13. get_template_part( 'template-parts/content', 'grid' );
  14. else:
  15. ?>
  16. <article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
  17. <div class="xpost-item shadow pb-5 mb-5">
  18. <?php xshop_post_thumbnail(); ?>
  19. <div class="xpost-text p-3">
  20. <header class="entry-header text-center pb-4">
  21. <?php
  22. if ( is_singular() ) :
  23. the_title( '<h1 class="entry-title">', '</h1>' );
  24. else :
  25. the_title( '<h2 class="entry-title"><a href="' . esc_url( get_permalink() ) . '" rel="bookmark">', '</a></h2>' );
  26. endif;
  27. if ( 'post' === get_post_type() ) :
  28. ?>
  29. <div class="entry-meta">
  30. <?php
  31. xshop_posted_on();
  32. xshop_posted_by();
  33. ?>
  34. </div><!-- .entry-meta -->
  35. <?php endif; ?>
  36. </header><!-- .entry-header -->
  37. <div class="entry-content">
  38. <?php
  39. if(is_single()){
  40. the_content(
  41. sprintf(
  42. wp_kses(
  43. /* translators: %s: Name of current post. Only visible to screen readers */
  44. __( 'Continue reading<span class="screen-reader-text"> "%s"</span>', 'xshop-lite' ),
  45. array(
  46. 'span' => array(
  47. 'class' => array(),
  48. ),
  49. )
  50. ),
  51. wp_kses_post( get_the_title() )
  52. )
  53. );
  54. wp_link_pages(
  55. array(
  56. 'before' => '<div class="page-links">' . esc_html__( 'Pages:', 'xshop-lite' ),
  57. 'after' => '</div>',
  58. )
  59. );
  60. }else{
  61. the_excerpt( );
  62. }
  63. ?>
  64. </div><!-- .entry-content -->
  65. <footer class="entry-footer">
  66. <?php xshop_entry_footer(); ?>
  67. </footer><!-- .entry-footer -->
  68. </div>
  69. </div>
  70. </article><!-- #post-<?php the_ID(); ?> -->
  71. <?php endif; ?>