archive-faculty.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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. <div class="sections">
  13. <section id="all-faculties" class="container">
  14. <h2>List of Faculty Members of Department of CSE</h2>
  15. <!-- <hr> -->
  16. <div class="parent-grid">
  17. <?php if (have_posts()) : ?>
  18. <?php while (have_posts()) : the_post();
  19. $login_id_e = "";
  20. $auth_token = get_field('auth_token', 'option');
  21. $client_id = get_field('client_id', 'option');
  22. $employee_info_api = get_field('employee_info_api', 'option');
  23. if (function_exists('get_field')) {
  24. $pid_content = get_post();
  25. if (has_blocks($pid_content)) {
  26. $blocks = parse_blocks($pid_content->post_content);
  27. foreach ($blocks as $block) {
  28. if ($block["blockName"] == "acf/faculty-member") {
  29. // $FullName = $block['login_id_e'];
  30. $login_id_e = $block["attrs"]["data"]["login_id"];
  31. // $Designation = $block["attrs"]["data"];
  32. }
  33. }
  34. }
  35. };
  36. $response_employeeInfo = wp_remote_post(
  37. $employee_info_api,
  38. array(
  39. 'body' => array(
  40. 'user_login_id' => $client_id,
  41. 'login_id' => $login_id_e,
  42. 'auth_token' => $auth_token
  43. )
  44. )
  45. );
  46. $employeeInfo = json_decode(wp_remote_retrieve_body($response_employeeInfo), true);
  47. $Title = $employeeInfo[0]['Title'];
  48. $FullName = $Title . ' ' . $employeeInfo[0]['FullName'];
  49. $Designation = $employeeInfo[0]['Designation'] . ', ' . $employeeInfo[0]['Office'];
  50. ?>
  51. <div class="faculty-stub grid-sub-item">
  52. <div class="stub-img-holder">
  53. <img class="stub-img" src="<?php the_field('profile_photo'); ?>" alt="">
  54. </div>
  55. <a class="faculty-link" href="<?php echo get_the_permalink(); ?>">
  56. <div class="archive-faculty-details">
  57. <h3>
  58. <?php echo $FullName; ?><span class="degree"><?php if ($Title == "Dr.") {
  59. echo ', PhD';
  60. } ?></span>
  61. </h3>
  62. <span class="faculty-designation">
  63. <?php echo $Designation; ?>
  64. </span>
  65. </div>
  66. </a>
  67. </div>
  68. <?php endwhile; ?>
  69. <?php the_posts_navigation(); ?>
  70. <?php
  71. else :
  72. get_template_part('template-parts/content', 'none');
  73. endif;
  74. ?>
  75. </div>
  76. <div class="grid">
  77. </div>
  78. </section>
  79. </div>
  80. </main><!-- #main -->
  81. <style>
  82. @import url("https://fonts.googleapis.com/css2?family=DM+Serif+Text&display=swap");
  83. @import url("https://fonts.googleapis.com/css2?family=Open+Sans&display=swap");
  84. @import url(https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.2.1/css/all.min.css);
  85. header {
  86. height: 100px !important;
  87. }
  88. #all-faculties h2 {
  89. color: #000 !important;
  90. margin-top: 40px;
  91. margin-bottom: 20px;
  92. }
  93. #all-faculties .faculty-stub {
  94. width: 100%;
  95. padding: 5px;
  96. box-shadow: 2px 2px 10px 6px rgba(0, 0, 0, 0.137254902);
  97. margin: 30px auto;
  98. }
  99. #all-faculties .stub-img-holder {
  100. border-radius: 4px !important;
  101. height: 160px;
  102. overflow: hidden;
  103. }
  104. #all-faculties .stub-img-holder img {
  105. border-radius: 0px !important;
  106. height: 100%;
  107. width: 100%;
  108. -o-object-fit: cover;
  109. object-fit: cover;
  110. -o-object-position: center;
  111. object-position: center;
  112. }
  113. #all-faculties .archive-faculty-details {
  114. height: 100px;
  115. padding: 0px 10px;
  116. }
  117. #all-faculties .archive-faculty-details .faculty-degree {
  118. display: inline-block;
  119. color: rgba(89, 107, 161, 0.5647058824);
  120. font-weight: 800;
  121. font-size: 14px;
  122. }
  123. #all-faculties .archive-faculty-details .faculty-designation {
  124. display: block;
  125. color: rgba(0, 0, 0, 0.5647058824);
  126. font-weight: 800;
  127. font-size: 14px;
  128. }
  129. #all-faculties .archive-faculty-details h3 {
  130. font-size: 18px;
  131. line-height: 22px;
  132. font-family: "Open Sans", sans-serif;
  133. color: #2F4858 !important;
  134. margin: 10px auto;
  135. }
  136. /*# sourceMappingURL=archive-faculty.css.map */
  137. </style>
  138. <?php
  139. get_footer();