archive-faculty.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246
  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="main" class="site-main" role="main">
  12. <section id="archive-hero">
  13. <div class="container">
  14. <!-- breadcrumb -->
  15. <nav aria-label="breadcrumb">
  16. <ul>
  17. <li><a href="#">Home</a></li>
  18. <li><a href="#">Category</a></li>
  19. <li>Faculty</li>
  20. </ul>
  21. </nav>
  22. <div class="content">
  23. <!-- left content -->
  24. <div class="left-content">
  25. <div class="main-title">Faculty Members</div>
  26. <div class="short-details">
  27. As a graduate you will have access to all United International University faculty members
  28. </div>
  29. <div class="links">
  30. <!-- message -->
  31. <a href="#">
  32. <img src="<?php echo (get_template_directory_uri()) ?>/img/envelope-solid.svg" alt="">
  33. </a>
  34. <!-- printer -->
  35. <a href="#">
  36. <img src="<?php echo (get_template_directory_uri()) ?>/img/print-solid.svg" alt="">
  37. </a>
  38. <!-- facebook -->
  39. <a href="#">
  40. <img src="<?php echo (get_template_directory_uri()) ?>/img/facebook-f.svg" alt="">
  41. </a>
  42. <!-- twitter -->
  43. <a href="#">
  44. <img src="<?php echo (get_template_directory_uri()) ?>/img/twitter.svg" alt="">
  45. </a>
  46. <!-- linkedin -->
  47. <a href="#">
  48. <img src="<?php echo (get_template_directory_uri()) ?>/img/linkedin-in.svg" alt="">
  49. </a>
  50. </div>
  51. </div>
  52. <!-- right content -->
  53. <div class="right-content">
  54. <img src="<?php echo (get_template_directory_uri()) ?>/img/campus_07.jpg" alt="">
  55. </div>
  56. </div>
  57. </div>
  58. </section>
  59. <div class="sections">
  60. <section id="all-faculties" class="container">
  61. <!-- <hr> -->
  62. <div class="parent-grid">
  63. <?php if (have_posts()) : ?>
  64. <?php while (have_posts()) : the_post();
  65. $login_id_e = "";
  66. $auth_token = get_field('auth_token', 'option');
  67. $client_id = get_field('client_id', 'option');
  68. $employee_info_api = get_field('employee_info_api', 'option');
  69. if (function_exists('get_field')) {
  70. $pid_content = get_post();
  71. if (has_blocks($pid_content)) {
  72. $blocks = parse_blocks($pid_content->post_content);
  73. foreach ($blocks as $block) {
  74. if ($block["blockName"] == "acf/faculty-member") {
  75. // $FullName = $block['login_id_e'];
  76. $login_id_e = $block["attrs"]["data"]["login_id"];
  77. // $Designation = $block["attrs"]["data"];
  78. }
  79. }
  80. }
  81. };
  82. $response_employeeInfo = wp_remote_post(
  83. $employee_info_api,
  84. array(
  85. 'body' => array(
  86. 'user_login_id' => $client_id,
  87. 'login_id' => $login_id_e,
  88. 'auth_token' => $auth_token
  89. )
  90. )
  91. );
  92. $employeeInfo = json_decode(wp_remote_retrieve_body($response_employeeInfo), true);
  93. $Title = $employeeInfo[0]['Title'];
  94. $FullName = $Title . ' ' . $employeeInfo[0]['FullName'];
  95. $Designation = $employeeInfo[0]['Designation'] . ', ' . $employeeInfo[0]['Office'];
  96. ?>
  97. <div class="faculty-stub grid-sub-item">
  98. <div class="stub-img-holder">
  99. <img class="stub-img" src="<?php the_field('profile_photo'); ?>" alt="">
  100. </div>
  101. <a class="faculty-link" href="<?php echo get_the_permalink(); ?>">
  102. <div class="archive-faculty-details">
  103. <h3>
  104. <?php echo $FullName; ?>
  105. <!-- <span class="degree"><?php //if ($Title == "Dr.") {echo ', PhD';}
  106. ?>
  107. </span> -->
  108. </h3>
  109. <span class="faculty-designation">
  110. <?php echo $Designation; ?>
  111. </span>
  112. </div>
  113. </a>
  114. </div>
  115. <?php endwhile; ?>
  116. <?php the_posts_navigation(); ?>
  117. <?php
  118. else :
  119. get_template_part('template-parts/content', 'none');
  120. endif;
  121. ?>
  122. </div>
  123. <div class="grid">
  124. </div>
  125. </section>
  126. </div>
  127. </main><!-- #main -->
  128. <style>
  129. @import url("https://fonts.googleapis.com/css2?family=DM+Serif+Text&display=swap");
  130. @import url("https://fonts.googleapis.com/css2?family=Open+Sans&display=swap");
  131. @import url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css);
  132. header {
  133. height: 100px !important;
  134. }
  135. #all-faculties h2 {
  136. color: #000 !important;
  137. margin-top: 40px;
  138. margin-bottom: 20px;
  139. }
  140. #all-faculties .faculty-stub {
  141. width: 100%;
  142. padding: 5px;
  143. box-shadow: 2px 2px 10px 6px rgba(0, 0, 0, 0.137254902);
  144. margin: 30px auto;
  145. }
  146. #all-faculties .stub-img-holder {
  147. border-radius: 4px !important;
  148. height: 160px;
  149. overflow: hidden;
  150. }
  151. #all-faculties .stub-img-holder img {
  152. border-radius: 0px !important;
  153. height: 100%;
  154. width: 100%;
  155. -o-object-fit: cover;
  156. object-fit: cover;
  157. -o-object-position: center;
  158. object-position: center;
  159. }
  160. #all-faculties .archive-faculty-details {
  161. height: 100px;
  162. padding: 0px 10px;
  163. }
  164. #all-faculties .archive-faculty-details .faculty-degree {
  165. display: inline-block;
  166. color: rgba(89, 107, 161, 0.5647058824);
  167. font-weight: 800;
  168. font-size: 14px;
  169. }
  170. #all-faculties .archive-faculty-details .faculty-designation {
  171. display: block;
  172. color: rgba(0, 0, 0, 0.5647058824);
  173. font-weight: 800;
  174. font-size: 14px;
  175. }
  176. #all-faculties .archive-faculty-details h3 {
  177. font-size: 18px;
  178. line-height: 22px;
  179. font-family: "Open Sans", sans-serif;
  180. color: #2F4858 !important;
  181. margin: 10px auto;
  182. }
  183. /*# sourceMappingURL=archive-faculty.css.map */
  184. </style>
  185. <?php
  186. get_footer();