archive-event.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <?php
  2. /**
  3. * The template for displaying news archive page
  4. *
  5. * @link https://developer.wordpress.org/themes/basics/template-hierarchy/
  6. *
  7. * @package UIU_CSE
  8. */
  9. get_header();
  10. ?>
  11. <main id="primary" class="site-main">
  12. <div class="sections">
  13. <section id="all-events" class="container">
  14. <h2>All Events</h2>
  15. <hr>
  16. <div class="parent-grid">
  17. <?php if (have_posts()) : ?>
  18. <?php while (have_posts()) : the_post(); ?>
  19. <div class="stub grid-sub-item">
  20. <div class="stub-img-holder">
  21. <img class="stub-img" src="<?php echo get_the_post_thumbnail_url() ?>" alt="">
  22. </div>
  23. <a href="<?php echo get_permalink(); ?>">
  24. <h3><?php echo get_the_title(); ?></h3>
  25. </a>
  26. <span class="events-date">Venue: <?php the_field('event_venue'); ?></span>
  27. <span class="events-date"><?php the_field('event_date_start'); ?> --- <?php the_field('event_date_end'); ?></span>
  28. </div>
  29. <?php endwhile; ?>
  30. <?php the_posts_navigation(); ?>
  31. <?php
  32. else :
  33. get_template_part('template-parts/content', 'none');
  34. endif;
  35. ?>
  36. </div>
  37. </section>
  38. </div>
  39. </main><!-- #main -->
  40. <style>
  41. @import url("https://fonts.googleapis.com/css2?family=DM+Serif+Text&display=swap");
  42. @import url("https://fonts.googleapis.com/css2?family=Open+Sans&display=swap");
  43. @import url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css);
  44. header {
  45. height: 100px !important;
  46. }
  47. #all-events {
  48. display: flex;
  49. flex-direction: column;
  50. }
  51. #all-events h2 {
  52. color: #000 !important;
  53. margin-top: 40px;
  54. margin-bottom: 20px;
  55. }
  56. #all-events .stub {
  57. margin: 30px auto;
  58. }
  59. #all-events .stub-img-holder {
  60. height: 200px;
  61. overflow: hidden;
  62. }
  63. #all-events .stub-img-holder img {
  64. height: 100%;
  65. width: 100%;
  66. -o-object-fit: cover;
  67. object-fit: cover;
  68. -o-object-position: center;
  69. object-position: center;
  70. }
  71. #all-events .events-date {
  72. display: block;
  73. color: #485680;
  74. font-weight: 800;
  75. font-size: 14px;
  76. margin: 10px 0px !important;
  77. }
  78. #all-events h3 {
  79. height: 50px;
  80. font-size: 18px;
  81. line-height: 22px;
  82. font-family: "Open Sans", sans-serif;
  83. color: #2F4858 !important;
  84. margin: 20px auto;
  85. }
  86. /*# sourceMappingURL=archive-events.css.map */
  87. </style>
  88. <?php
  89. get_footer();