archive-faculty.php 5.4 KB

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