page-archive-event.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213
  1. <?php
  2. /**
  3. * The template for displaying Event archive page
  4. *
  5. * Template Name: Archive - Event
  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>Events</li>
  21. </ul>
  22. </nav>
  23. <div class="content">
  24. <!-- left content -->
  25. <div class="left-content">
  26. <div class="main-title">Events</div>
  27. <div class="short-details">
  28. Here you will have access to all United International University Events.
  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. <div class="sections">
  61. <section id="all-events" class="container">
  62. <!-- <hr> -->
  63. <div class="parent-grid">
  64. <?php
  65. $args = array(
  66. 'post_type' => 'event',
  67. 'meta_query' => array(
  68. 'relation' => 'OR',
  69. array(
  70. 'key' => 'related_institutes',
  71. 'value' => 'BBA',
  72. 'compare' => 'LIKE'
  73. ),
  74. array(
  75. 'key' => 'related_institutes',
  76. 'value' => 'sobe',
  77. 'compare' => 'LIKE'
  78. ),
  79. array(
  80. 'key' => 'related_institutes',
  81. 'value' => 'all_departments',
  82. 'compare' => 'LIKE'
  83. ),
  84. array(
  85. 'key' => 'related_institutes',
  86. 'value' => 'all_sites',
  87. 'compare' => 'LIKE'
  88. )
  89. ),
  90. 'posts_per_page' => 6,
  91. 'orderby' => 'date',
  92. 'order' => 'DESC',
  93. );
  94. $query = new WP_Query($args);
  95. if ($query->have_posts()) :
  96. while ($query->have_posts()) :
  97. $query->the_post(); ?>
  98. <div class="stub grid-sub-item">
  99. <div class="stub-img-holder">
  100. <img class="stub-img" src="<?php echo get_the_post_thumbnail_url() ?>" alt="">
  101. </div>
  102. <a href="<?php echo get_permalink(); ?>">
  103. <h3><?php echo get_the_title(); ?></h3>
  104. </a>
  105. <span class="events-date">Venue: <?php the_field('event_venue'); ?></span>
  106. <span class="events-date"><?php the_field('event_date_start'); ?> --- <?php the_field('event_date_end'); ?></span>
  107. </div>
  108. <?php endwhile; ?>
  109. <?php the_posts_navigation(); ?>
  110. <?php
  111. else :
  112. get_template_part('template-parts/content', 'none');
  113. endif;
  114. ?>
  115. </div>
  116. </section>
  117. </div>
  118. </main><!-- #main -->
  119. <style>
  120. @import url("https://fonts.googleapis.com/css2?family=DM+Serif+Text&display=swap");
  121. @import url("https://fonts.googleapis.com/css2?family=Open+Sans&display=swap");
  122. @import url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css);
  123. header {
  124. height: 100px !important;
  125. }
  126. #all-events {
  127. display: flex;
  128. flex-direction: column;
  129. }
  130. #all-events h2 {
  131. color: #000 !important;
  132. margin-top: 40px;
  133. margin-bottom: 20px;
  134. }
  135. #all-events .stub {
  136. margin: 30px auto;
  137. }
  138. #all-events .stub-img-holder {
  139. height: 200px;
  140. overflow: hidden;
  141. }
  142. #all-events .stub-img-holder img {
  143. height: 100%;
  144. width: 100%;
  145. -o-object-fit: cover;
  146. object-fit: cover;
  147. -o-object-position: center;
  148. object-position: center;
  149. }
  150. #all-events .events-date {
  151. display: block;
  152. color: #485680;
  153. font-weight: 800;
  154. font-size: 14px;
  155. margin: 10px 0px !important;
  156. }
  157. #all-events h3 {
  158. height: 50px;
  159. font-size: 18px;
  160. line-height: 22px;
  161. font-family: "Open Sans", sans-serif;
  162. color: #2F4858 !important;
  163. margin: 20px auto;
  164. }
  165. /*# sourceMappingURL=archive-events.css.map */
  166. </style>
  167. <?php
  168. get_footer();