single-notice.php 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523
  1. <?php
  2. /**
  3. * The template for displaying all single notice posts
  4. *
  5. * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
  6. *
  7. * @package UIU_DEPARTMENTAL
  8. */
  9. get_header(); ?>
  10. <?php while (have_posts()) : the_post(); ?>
  11. <main id="main" class="site-main" role="main">
  12. <section id="hero-single">
  13. <div class="container">
  14. <!-- page title -->
  15. <div class="page-title">
  16. Notice
  17. </div>
  18. <!-- breadcrumb -->
  19. <nav class="breadcrumb" aria-label="breadcrumb">
  20. <ul>
  21. <li><a href="/">Home</a></li>
  22. <li><a href="/notice/">Notice</a></li>
  23. </ul>
  24. </nav>
  25. <div class="content">
  26. <!-- main title -->
  27. <div class="main-title">
  28. <?php echo get_the_title(); ?>
  29. </div>
  30. <div class="publish-date">
  31. <span class="title">Publish Date :</span>
  32. <span class="date"><?php echo get_the_date(); ?></span>
  33. </div>
  34. <div class="links">
  35. <!-- message -->
  36. <a href="mailto:#">
  37. <img src="<?php echo (get_template_directory_uri()) ?>/img/envelope-solid.svg" alt="">
  38. </a>
  39. <!-- printer -->
  40. <a onclick="window.print()">
  41. <img src="<?php echo (get_template_directory_uri()) ?>/img/print-solid.svg" alt="">
  42. </a>
  43. <!-- facebook -->
  44. <a href="#">
  45. <img src="<?php echo (get_template_directory_uri()) ?>/img/facebook-f.svg" alt="">
  46. </a>
  47. <!-- twitter -->
  48. <a href="#">
  49. <img src="<?php echo (get_template_directory_uri()) ?>/img/twitter.svg" alt="">
  50. </a>
  51. <!-- linkedin -->
  52. <a href="#">
  53. <img src="<?php echo (get_template_directory_uri()) ?>/img/linkedin-in.svg" alt="">
  54. </a>
  55. </div>
  56. </div>
  57. </div>
  58. </section>
  59. <div class="container">
  60. <section id="notice-container">
  61. <!-- main component -->
  62. <div class="main-comp">
  63. <div class="feature-image-holder">
  64. <img src="<?php echo get_the_post_thumbnail_url(); ?>" alt="">
  65. </div>
  66. <!-- notice details -->
  67. <div class="notice-details">
  68. <?php the_content(); ?>
  69. </div>
  70. </div>
  71. <!-- side component -->
  72. <div class="side-comp">
  73. <!-- notice -->
  74. <div class="item">
  75. <!-- title -->
  76. <div class="item-title">
  77. NOTICES
  78. </div>
  79. <!-- item container -->
  80. <div class="item-container">
  81. <?php
  82. $args = array(
  83. 'post_type' => 'notice',
  84. 'posts_per_page' => 6,
  85. 'post__not_in' => array(get_the_ID()),
  86. 'orderby' => 'date',
  87. 'order' => 'DESC',
  88. );
  89. $query = new WP_Query($args);
  90. if ($query->have_posts()) :
  91. while ($query->have_posts()) :
  92. $query->the_post(); ?>
  93. <div class="item-container">
  94. <a class="single-item" href="<?php echo get_permalink(); ?>">
  95. <div class="date">
  96. <?php the_field('news_date'); ?>
  97. </div>
  98. <div class="details">
  99. <?php echo get_the_title(); ?>
  100. </div>
  101. </a>
  102. </div>
  103. <?php
  104. endwhile;
  105. else :
  106. echo '<div class="no-post-found">No related notice has found! </div>';
  107. endif; ?>
  108. </div>
  109. <!-- view more button -->
  110. <a class="view-more" href="/notice">
  111. <div class="icon">
  112. <img src="<?php echo (get_template_directory_uri()) ?>/img/square-plus-solid.svg" alt="">
  113. </div>
  114. <span>
  115. View All Notice
  116. </span>
  117. </a>
  118. </div>
  119. <!-- news -->
  120. <div class="item">
  121. <!-- title -->
  122. <div class="item-title">
  123. NEWS
  124. </div>
  125. <?php
  126. $args = array(
  127. 'post_type' => 'news',
  128. 'posts_per_page' => 6,
  129. 'post__not_in' => array(get_the_ID()),
  130. 'orderby' => 'date',
  131. 'order' => 'DESC',
  132. );
  133. $query = new WP_Query($args);
  134. if ($query->have_posts()) :
  135. while ($query->have_posts()) :
  136. $query->the_post(); ?>
  137. <div class="item-container">
  138. <a class="single-item" href="<?php echo get_permalink(); ?>">
  139. <div class="date">
  140. <?php the_field('news_date'); ?>
  141. </div>
  142. <div class="details">
  143. <?php echo get_the_title(); ?>
  144. </div>
  145. </a>
  146. </div>
  147. <?php
  148. endwhile;
  149. else :
  150. echo '<div class="no-post-found">No related news has found! </div>';
  151. endif; ?>
  152. <!-- view more button -->
  153. <a class="view-more" href="/news">
  154. <div class="icon">
  155. <img src="<?php echo (get_template_directory_uri()) ?>/img/square-plus-solid.svg" alt="">
  156. </div>
  157. <span>
  158. View All News
  159. </span>
  160. </a>
  161. </div>
  162. </div>
  163. </section>
  164. </div>
  165. </main>
  166. <?php endwhile; ?>
  167. <style>
  168. #hero-single {
  169. padding: 6rem 0 3rem;
  170. }
  171. #hero-single .page-title {
  172. font-size: 1.8rem;
  173. font-weight: bold;
  174. color: #0f465e;
  175. font-family: "DM Serif Text", serif;
  176. letter-spacing: 3px;
  177. }
  178. #hero-single .breadcrumb {
  179. margin-top: 0 !important;
  180. }
  181. #hero-single .breadcrumb li {
  182. padding-top: 10px;
  183. padding-bottom: 10px;
  184. font-size: 0.8rem;
  185. font-weight: 600;
  186. }
  187. #hero-single .content {
  188. display: block;
  189. }
  190. #hero-single .main-title {
  191. margin-top: 1.5rem;
  192. font-size: 1.7rem;
  193. font-weight: bold;
  194. letter-spacing: 2px;
  195. line-height: 1.4 !important;
  196. color: #333 !important;
  197. text-transform: capitalize;
  198. font-family: "DM Serif Text", serif;
  199. }
  200. #hero-single .publish-date {
  201. margin-top: 0.75rem;
  202. font-size: 0.8rem;
  203. }
  204. #hero-single .publish-date .title {
  205. font-weight: bold;
  206. }
  207. #hero-single .publish-date .date {
  208. margin-left: 0.25rem;
  209. font-weight: 600;
  210. }
  211. #hero-single .links {
  212. margin-top: 2.5rem;
  213. padding-top: 1rem;
  214. border-top: 1px solid #000;
  215. display: flex;
  216. gap: 1.5rem;
  217. }
  218. #hero-single .links a {
  219. height: 1.2rem;
  220. }
  221. #hero-single .links a:hover {
  222. transform: scale(1.2);
  223. opacity: 1 !important;
  224. }
  225. #hero-single .links a img {
  226. height: 100%;
  227. }
  228. #notice-info {
  229. padding-top: 0;
  230. margin-bottom: 1rem;
  231. }
  232. #notice-info .content {
  233. background: #0f465e;
  234. padding: 1.5rem 2rem;
  235. color: #fff;
  236. }
  237. #notice-info .content .single-content {
  238. display: flex;
  239. align-items: flex-start;
  240. margin-bottom: 0.75rem;
  241. font-size: 0.8rem;
  242. }
  243. #notice-info .content .single-content:last-child {
  244. margin-bottom: unset;
  245. }
  246. #notice-info .content .single-content .title {
  247. min-width: 200px;
  248. font-weight: 700;
  249. font-size: inherit;
  250. }
  251. #notice-info .content .single-content .detail {
  252. font-size: inherit;
  253. font-weight: 500;
  254. }
  255. a {
  256. transition: all 0.25s ease-in-out;
  257. }
  258. a:hover {
  259. opacity: 0.65;
  260. text-decoration: none;
  261. }
  262. #notice-container {
  263. margin: 0.5rem 0;
  264. display: flex;
  265. gap: 1rem;
  266. }
  267. @media (max-width: 1000px) {
  268. #notice-container {
  269. display: block;
  270. }
  271. }
  272. #notice-container .main-comp {
  273. flex: 5;
  274. padding: 0 0.75rem 1rem 0;
  275. }
  276. #notice-container .main-comp .feature-image-holder {
  277. width: 100%;
  278. margin-bottom: 2rem;
  279. }
  280. #notice-container .main-comp .feature-image-holder img {
  281. width: 100%;
  282. }
  283. #notice-container .main-comp .notice-details {
  284. margin-top: 1rem;
  285. }
  286. #notice-container .main-comp .notice-details img {
  287. width: 100%;
  288. margin-bottom: 2rem;
  289. }
  290. #notice-container .side-comp {
  291. flex: 2;
  292. padding: 0 0.25rem 1rem 0 !important;
  293. }
  294. #notice-container .side-comp .item {
  295. margin-bottom: 2rem;
  296. border: 1px solid #2c5d73;
  297. }
  298. #notice-container .side-comp .item .item-title {
  299. padding: 0.25rem 1rem;
  300. text-align: center;
  301. background: #2c5d73;
  302. color: #fff;
  303. }
  304. #notice-container .side-comp .item .item-container {
  305. padding: 0.5rem;
  306. }
  307. #notice-container .side-comp .item .item-container .single-item {
  308. display: block;
  309. margin-bottom: 0.75rem;
  310. padding-bottom: 2rem;
  311. border-bottom: 1px solid #2c5d73;
  312. transition: all 0.25s ease-in-out;
  313. }
  314. #notice-container .side-comp .item .item-container .single-item:last-child {
  315. border-bottom: none;
  316. margin-bottom: 0rem;
  317. padding-bottom: 0.25rem;
  318. }
  319. #notice-container .side-comp .item .item-container .single-item .date {
  320. font-size: 0.8rem;
  321. font-weight: 500;
  322. color: #c66f17;
  323. }
  324. #notice-container .side-comp .item .item-container .single-item .single-item-title {
  325. font-size: 0.8rem;
  326. font-weight: 700;
  327. color: #2c5d73;
  328. }
  329. #notice-container .side-comp .item .item-container .single-item .date-container {
  330. display: flex;
  331. align-items: center;
  332. gap: 0.7rem;
  333. }
  334. #notice-container .side-comp .item .item-container .single-item .date-container .date {
  335. font-size: 0.75rem;
  336. }
  337. #notice-container .side-comp .item .item-container .single-item .date-container .icon {
  338. width: 0.75rem;
  339. color: #ffffff;
  340. }
  341. #notice-container .side-comp .item .item-container .single-item .date-container .icon img {
  342. width: 100%;
  343. }
  344. #notice-container .side-comp .item .item-container .single-item .details {
  345. font-size: 0.7rem;
  346. margin-top: 0.3rem;
  347. color: #232323;
  348. }
  349. #notice-container .side-comp .item .news {
  350. font-size: 0.7rem !important;
  351. padding-bottom: 2rem !important;
  352. }
  353. #notice-container .side-comp .item .view-more {
  354. display: flex;
  355. align-items: center;
  356. padding: 0 0.5rem 0.5rem;
  357. gap: 0.5rem;
  358. }
  359. #notice-container .side-comp .item .view-more .icon {
  360. width: 1rem;
  361. }
  362. #notice-container .side-comp .item .view-more .icon img {
  363. width: 100%;
  364. }
  365. #notice-container .side-comp .item .view-more span {
  366. font-size: 0.85rem;
  367. color: #2F4858;
  368. font-weight: bolder !important;
  369. transition: all 0.35s ease-in-out;
  370. }
  371. #notice-container .side-comp .item .view-more:hover {
  372. opacity: 1;
  373. }
  374. #notice-container .side-comp .item .view-more:hover span {
  375. color: #E55807;
  376. }
  377. @media print {
  378. head,
  379. header,
  380. footer {
  381. display: none;
  382. }
  383. main {
  384. padding-top: 0 !important;
  385. margin-top: 0 !important;
  386. }
  387. #archive-hero {
  388. margin: 0;
  389. }
  390. #notice-container {
  391. padding: 0;
  392. }
  393. }
  394. /*# sourceMappingURL=single-notice.css.map */
  395. </style>
  396. <?php get_footer(); ?>