page-archive-notice.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. <?php
  2. /**
  3. * The template for displaying notice archive page
  4. *
  5. * Template Name: Archive - Notice
  6. *
  7. * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  8. *
  9. * @package UIU_DEPARTMENTAL
  10. */
  11. get_header();
  12. ?>
  13. <main id="primary" class="site-main">
  14. <section id="archive-hero">
  15. <div class="container">
  16. <!-- breadcrumb -->
  17. <nav aria-label="breadcrumb">
  18. <ul>
  19. <li><a href="/">Home</a></li>
  20. <li>Notice</li>
  21. </ul>
  22. </nav>
  23. <div class="content">
  24. <!-- left content -->
  25. <div class="left-content">
  26. <div class="main-title">Notice</div>
  27. <div class="short-details">
  28. Here you will have access to all United International University Notices.
  29. </div>
  30. <div class="links">
  31. <!-- message -->
  32. <a href="#">
  33. <img src="<?php echo (get_template_directory_uri()) ?>/img/envelope-solid.svg" alt="">
  34. </a>
  35. <!-- printer -->
  36. <a href="#">
  37. <img src="<?php echo (get_template_directory_uri()) ?>/img/print-solid.svg" alt="">
  38. </a>
  39. <!-- facebook -->
  40. <a href="#">
  41. <img src="<?php echo (get_template_directory_uri()) ?>/img/facebook-f.svg" alt="">
  42. </a>
  43. <!-- twitter -->
  44. <a href="#">
  45. <img src="<?php echo (get_template_directory_uri()) ?>/img/twitter.svg" alt="">
  46. </a>
  47. <!-- linkedin -->
  48. <a href="#">
  49. <img src="<?php echo (get_template_directory_uri()) ?>/img/linkedin-in.svg" alt="">
  50. </a>
  51. </div>
  52. </div>
  53. <!-- right content -->
  54. <div class="right-content">
  55. <img src="<?php echo (get_template_directory_uri()) ?>/img/campus_07.jpg" alt="">
  56. </div>
  57. </div>
  58. </div>
  59. </section>
  60. <section class="container">
  61. <div id="notice-container">
  62. <?php
  63. $current_parent_page_slug = get_parent_page_slug(); // custom function in theme-settings.php
  64. $args = array(
  65. 'post_type' => 'notice',
  66. 'meta_query' => array(
  67. 'relation' => 'OR',
  68. array(
  69. 'key' => 'related_institutes',
  70. 'value' => $current_parent_page_slug,
  71. 'compare' => 'LIKE'
  72. ),
  73. array(
  74. 'key' => 'related_institutes',
  75. 'value' => 'sobe',
  76. 'compare' => 'LIKE'
  77. ),
  78. array(
  79. 'key' => 'related_institutes',
  80. 'value' => 'all_departments',
  81. 'compare' => 'LIKE'
  82. ),
  83. array(
  84. 'key' => 'related_institutes',
  85. 'value' => 'all_sites',
  86. 'compare' => 'LIKE'
  87. )
  88. ),
  89. 'posts_per_page' => 6,
  90. 'orderby' => 'date',
  91. 'order' => 'DESC',
  92. );
  93. $query = new WP_Query($args);
  94. if ($query->have_posts()) :
  95. while ($query->have_posts()) :
  96. $query->the_post(); ?>
  97. <!-- single notice -->
  98. <div class="notice">
  99. <div class="image">
  100. <img src="<?php echo get_the_post_thumbnail_url() ?>" alt="">
  101. </div>
  102. <div class="details">
  103. <!-- date -->
  104. <div class="date-container">
  105. <!-- icon -->
  106. <span class="icon">
  107. <img src="<?php echo (get_template_directory_uri()) ?>/img/calendar-days-regular.svg" alt="">
  108. </span>
  109. <!-- date -->
  110. <span class="date">
  111. June 4th, 2023
  112. </span>
  113. </div>
  114. <div class="title">
  115. <a href="<?php echo get_permalink(); ?>">
  116. <?php echo get_the_title(); ?>
  117. </a>
  118. </div>
  119. </div>
  120. </div>
  121. <?php endwhile; ?>
  122. <?php the_posts_navigation(); ?>
  123. <?php
  124. else :
  125. get_template_part('template-parts/content', 'none');
  126. endif;
  127. ?>
  128. </div>
  129. </section>
  130. </main><!-- #main -->
  131. <style>
  132. #notice-container {
  133. padding: 2rem 0;
  134. display: flex;
  135. flex-wrap: wrap;
  136. gap: 1.5rem;
  137. }
  138. #notice-container .notice {
  139. width: calc(25% - 1.5rem);
  140. margin-bottom: 1rem !important;
  141. }
  142. #notice-container .notice .image {
  143. width: 100%;
  144. border-bottom: 4px solid #F68B1F;
  145. overflow: hidden;
  146. }
  147. #notice-container .notice .image img {
  148. width: 100%;
  149. transition: 5s;
  150. }
  151. #notice-container .notice .image img:hover {
  152. transform: scale(1.5);
  153. }
  154. #notice-container .notice .details {
  155. padding: 0.25rem;
  156. }
  157. #notice-container .notice .details .date-container {
  158. margin-top: 0.75rem;
  159. font-size: 0.7rem;
  160. font-weight: 700;
  161. color: #2c5d73;
  162. display: flex;
  163. align-items: center;
  164. gap: 0.35rem;
  165. }
  166. #notice-container .notice .details .date-container .icon {
  167. width: 0.7rem;
  168. }
  169. #notice-container .notice .details .date-container .icon img {
  170. width: 100%;
  171. }
  172. #notice-container .notice .details .title {
  173. margin-top: 0.75rem;
  174. font-size: 0.9rem;
  175. color: #2c5d73;
  176. font-weight: 600;
  177. line-height: 1.4;
  178. }
  179. #notice-container .notice .details .title a {
  180. color: inherit !important;
  181. }
  182. /*# sourceMappingURL=archive-notice.css.map */
  183. </style>
  184. <?php
  185. get_footer();