No Description

archive.php 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <?php
  2. /**
  3. * The template for displaying archive pages
  4. *
  5. * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  6. *
  7. * @package XShop
  8. */
  9. $xshop_blog_container = get_theme_mod( 'xshop_blog_container', 'container' );
  10. $xshop_lite_blog_layout = get_theme_mod( 'xshop_lite_blog_layout', 'leftside' );
  11. $xshop_lite_blog_style = get_theme_mod( 'xshop_lite_blog_style', 'list' );
  12. if ( is_active_sidebar( 'sidebar-1' ) && $xshop_lite_blog_layout != 'fullwidth' ) {
  13. $xshop_blog_column = 'col-lg-9';
  14. }else{
  15. $xshop_blog_column = 'col-lg-12';
  16. }
  17. get_header();
  18. ?>
  19. <div class="<?php echo esc_attr($xshop_blog_container); ?> mt-5 mb-5 pt-5 pb-5">
  20. <div class="row">
  21. <?php if ( is_active_sidebar( 'sidebar-1' ) && $xshop_lite_blog_layout == 'leftside' ): ?>
  22. <div class="col-lg-3">
  23. <?php get_sidebar(); ?>
  24. </div>
  25. <?php endif; ?>
  26. <div class="<?php echo esc_attr($xshop_blog_column); ?>">
  27. <main id="primary" class="site-main">
  28. <?php if ( have_posts() ) : ?>
  29. <header class="page-header archive-header shadow p-4 mb-5 text-center">
  30. <?php
  31. the_archive_title( '<h1 class="page-title">', '</h1>' );
  32. the_archive_description( '<div class="archive-description">', '</div>' );
  33. ?>
  34. </header><!-- .page-header -->
  35. <?php if( $xshop_lite_blog_style == 'grid' ): ?>
  36. <div class="bplus-gridh mb-5">
  37. <div class="grid row" data-masonry='{"percentPosition": true }'>
  38. <?php endif; ?>
  39. <?php
  40. /* Start the Loop */
  41. while ( have_posts() ) :
  42. the_post();
  43. /*
  44. * Include the Post-Type-specific template for the content.
  45. * If you want to override this in a child theme, then include a file
  46. * called content-___.php (where ___ is the Post Type name) and that will be used instead.
  47. */
  48. get_template_part( 'template-parts/content', get_post_type() );
  49. endwhile;
  50. ?>
  51. <?php if( $xshop_lite_blog_style == 'grid' ): ?>
  52. </div>
  53. </div>
  54. <?php endif; ?>
  55. <?php
  56. the_posts_navigation();
  57. else :
  58. get_template_part( 'template-parts/content', 'none' );
  59. endif;
  60. ?>
  61. </main><!-- #main -->
  62. </div>
  63. <?php if ( is_active_sidebar( 'sidebar-1' ) && $xshop_lite_blog_layout == 'rightside' ): ?>
  64. <div class="col-lg-3">
  65. <?php get_sidebar(); ?>
  66. </div>
  67. <?php endif; ?>
  68. </div>
  69. </div>
  70. <?php
  71. get_footer();