single-faculty.php 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595
  1. <?php
  2. /**
  3. * The template for displaying all single faculty posts
  4. *
  5. * @package UIU_CSE
  6. */
  7. get_header(); ?>
  8. <?php while (have_posts()) : the_post();
  9. $auth_token = get_field('auth_token', 'option');
  10. $client_id = get_field('client_id', 'option');
  11. $employee_info_api = get_field('employee_info_api', 'option');
  12. $journal_api = get_field('journal_api', 'option');
  13. $conference_api = get_field('conference_api', 'option');
  14. $login_id_e = "";
  15. if (function_exists('get_field')) {
  16. $pid_content = get_post();
  17. if (has_blocks($pid_content)) {
  18. $blocks = parse_blocks($pid_content->post_content);
  19. foreach ($blocks as $block) {
  20. if ($block["blockName"] == "acf/faculty-member") {
  21. $login_id_e = $block["attrs"]["data"]["login_id"];
  22. }
  23. }
  24. }
  25. }
  26. $response_employeeInfo = wp_remote_post(
  27. $employee_info_api,
  28. array(
  29. 'body' => array(
  30. 'user_login_id' => $client_id,
  31. 'login_id' => $login_id_e,
  32. 'auth_token' => $auth_token
  33. )
  34. )
  35. );
  36. $employeeInfo = json_decode(wp_remote_retrieve_body($response_employeeInfo), true);
  37. $response_employeeJournal = wp_remote_post(
  38. $journal_api,
  39. array(
  40. 'body' => array(
  41. 'employee_id' => $login_id_e,
  42. "year" => "",
  43. 'user_login_id' => $client_id,
  44. 'auth_token' => $auth_token
  45. // 'page' => 1,
  46. // 'limit' => 1
  47. )
  48. )
  49. );
  50. $employeeJournal = json_decode(wp_remote_retrieve_body($response_employeeJournal), true);
  51. $response_employeeConference = wp_remote_post(
  52. $conference_api,
  53. array(
  54. 'body' => array(
  55. 'employee_id' => $login_id_e,
  56. "year" => "",
  57. 'user_login_id' => $client_id,
  58. 'auth_token' => $auth_token
  59. // 'page' => 1,
  60. // 'limit' => 1
  61. )
  62. )
  63. );
  64. $employeeConference = json_decode(wp_remote_retrieve_body($response_employeeConference), true);
  65. ?>
  66. <section class="static-banner">
  67. <div class="static-banner-underlay">
  68. <img src="<?php echo get_the_post_thumbnail_url(); ?>" alt="">
  69. </div>
  70. <div class="static-banner-overlay"></div>
  71. </section>
  72. <main>
  73. <section class="profile-header">
  74. <div class="profile-main">
  75. <div class="container">
  76. <div class="top-row">
  77. <div class="profile-img-container">
  78. <img src="<?php the_field('profile_photo'); ?>" alt="">
  79. </div>
  80. <div class="profile-header-text">
  81. <!-- <h3 class="sub-title">Faculty Profile</h3> -->
  82. <h1 class="profile-name">
  83. <?php echo get_the_title(); ?>
  84. </h1>
  85. <h2 class="profile-des">
  86. <?php the_field('designation'); ?>
  87. </h2>
  88. <?php if (have_rows('contact_details')) : ?>
  89. <?php while (have_rows('contact_details')) : the_row(); ?>
  90. <span class="contact-dets"><?php the_sub_field('contact_info'); ?></span>
  91. <?php
  92. // $sub_field_3 = get_sub_field('sub_field_3');
  93. // do something with $sub_field_3
  94. ?>
  95. <?php endwhile; ?>
  96. <?php endif; ?>
  97. </div>
  98. </div>
  99. </div>
  100. </div>
  101. </section>
  102. <section class="profile-body primary-c">
  103. <div class="container">
  104. <div class="profile-second-row">
  105. <div class="left-col">
  106. <ul class="profile-choices">
  107. </ul>
  108. </div>
  109. <div class="profile-main-description">
  110. <?php if (have_rows('main_information')) : ?>
  111. <?php while (have_rows('main_information')) : the_row(); ?>
  112. <span class="contact-dets"></span>
  113. <div class="bio desc-block">
  114. <h2 class="m-text"><?php the_sub_field('title'); ?></h2>
  115. <p class="m-text">
  116. <?php the_sub_field('contents'); ?>
  117. </p>
  118. </div>
  119. <?php endwhile; ?>
  120. <?php endif; ?>
  121. <div class="bio desc-block">
  122. <h2 class="m-text">Publication</h2>
  123. <p class="m-text">
  124. <?php
  125. echo '<pre>';
  126. print_r($employeeInfo);
  127. print_r($employeeJournal);
  128. print_r($employeeConference);
  129. ?>
  130. </div>
  131. </div>
  132. </div>
  133. </div>
  134. </section>
  135. </main>
  136. <!-- #main -->
  137. <?php endwhile; // end of the loop.
  138. ?>
  139. <style>
  140. header {
  141. margin: 0px !important;
  142. padding: 0px !important;
  143. height: 350px;
  144. overflow: hidden;
  145. }
  146. main {
  147. min-height: calc(100vh - 400px);
  148. position: relative;
  149. padding: 0px !important;
  150. background: rgb(56, 32, 23);
  151. background: linear-gradient(180deg, rgb(48, 18, 7) 0%, rgb(40, 21, 13) 22%, rgb(5, 0, 6) 100%);
  152. height: 100%;
  153. }
  154. h1 {
  155. font-family: "DM Serif Text", serif;
  156. font-size: 40px !important;
  157. letter-spacing: 2px !important;
  158. line-height: 110%;
  159. color: #fff;
  160. width: 100%;
  161. margin: 20px auto !important;
  162. text-align: left;
  163. }
  164. h2 {
  165. font-family: "DM Serif Text", serif;
  166. font-size: 40px;
  167. line-height: 45px;
  168. color: #ffc3c3;
  169. width: 100%;
  170. margin: 20px auto;
  171. text-align: left;
  172. }
  173. p {
  174. max-width: 1200px;
  175. font-size: 18px;
  176. color: #ffc3c3;
  177. margin: 50px 15px !important;
  178. }
  179. .desc-block ul>li {
  180. list-style: none;
  181. font-size: 16px;
  182. line-height: 20px;
  183. font-size: 18px;
  184. color: #ffc3c3;
  185. }
  186. .static-banner {
  187. position: relative;
  188. }
  189. .static-banner .static-banner-underlay {
  190. position: fixed;
  191. height: 100%;
  192. width: 100%;
  193. top: 0px;
  194. }
  195. .static-banner .static-banner-underlay img {
  196. height: 100%;
  197. width: 100%;
  198. -o-object-fit: cover;
  199. object-fit: cover;
  200. -o-object-position: bottom;
  201. object-position: bottom;
  202. }
  203. .static-banner .static-banner-overlay {
  204. position: fixed;
  205. width: 100%;
  206. height: 100%;
  207. background-color: #0b1419;
  208. opacity: 0.8;
  209. }
  210. .profile-header {
  211. position: absolute;
  212. top: -300px;
  213. width: 100%;
  214. }
  215. .top-row {
  216. display: flex;
  217. flex-direction: row;
  218. margin-top: 50px;
  219. }
  220. @media screen and (max-width: 600px) {
  221. .top-row {
  222. display: flex;
  223. flex-direction: column;
  224. justify-content: center;
  225. align-items: center;
  226. margin-top: -10px;
  227. }
  228. }
  229. .profile-img-container {
  230. flex-basis: 200px;
  231. border-radius: 50%;
  232. border: 2px solid #F68B1F;
  233. overflow: hidden;
  234. }
  235. .profile-img-container img {
  236. height: 100%;
  237. width: 100%;
  238. -o-object-position: top;
  239. object-position: top;
  240. -o-object-fit: cover;
  241. object-fit: cover;
  242. }
  243. @media screen and (max-width: 600px) {
  244. .profile-img-container {
  245. flex-basis: 100px;
  246. width: 100px !important;
  247. height: 100px !important;
  248. border-radius: 50%;
  249. border: 2px solid #F68B1F;
  250. overflow: hidden;
  251. }
  252. }
  253. .profile-header-text {
  254. margin: 20px 0px 0px 50px !important;
  255. }
  256. @media screen and (max-width: 600px) {
  257. .profile-header-text {
  258. margin: 20px 0px !important;
  259. }
  260. }
  261. .profile-header-text h1 {
  262. font-size: 40px !important;
  263. margin: 5px 0px !important;
  264. }
  265. .profile-header-text h2 {
  266. font-size: 20px !important;
  267. line-height: 24px !important;
  268. color: #fff;
  269. letter-spacing: 2px;
  270. font-weight: normal;
  271. margin: 5px 0px !important;
  272. }
  273. .profile-header-text .contact-dets {
  274. display: inline-block;
  275. font-size: 12px;
  276. margin-top: 15px !important;
  277. margin-right: 20px !important;
  278. font-weight: lighter;
  279. color: #fff;
  280. letter-spacing: 2px;
  281. }
  282. .profile-header-text h3 {
  283. font-size: 14px !important;
  284. text-transform: uppercase;
  285. text-decoration: none !important;
  286. font-family: "Open Sans", sans-serif;
  287. letter-spacing: 2px;
  288. text-align: center !important;
  289. font-weight: normal;
  290. margin: 5px 0px 0px 0px !important;
  291. text-align: left !important;
  292. }
  293. @media screen and (max-width: 700px) {
  294. .profile-header-text {
  295. text-align: center;
  296. }
  297. .profile-header-text h1 {
  298. font-size: 20px !important;
  299. margin: 5px 0px 0px 0px !important;
  300. text-align: center;
  301. }
  302. .profile-header-text h2 {
  303. font-size: 14px !important;
  304. line-height: 16px !important;
  305. color: #fff;
  306. letter-spacing: 2px;
  307. font-weight: normal;
  308. margin: 5px 0px 10px 0px !important;
  309. text-align: center;
  310. }
  311. .profile-header-text h3 {
  312. font-size: 14px !important;
  313. text-transform: uppercase;
  314. text-decoration: none !important;
  315. font-family: "Open Sans", sans-serif;
  316. letter-spacing: 2px;
  317. text-align: center !important;
  318. font-weight: normal;
  319. margin: 5px 0px 0px 0px !important;
  320. text-align: center;
  321. }
  322. .profile-header-text .contact-dets {
  323. display: block;
  324. font-size: 12px;
  325. margin-top: 5px !important;
  326. font-weight: lighter;
  327. color: #fff;
  328. letter-spacing: 1px;
  329. }
  330. }
  331. .profile-second-row {
  332. display: flex;
  333. flex-direction: row;
  334. justify-content: space-between;
  335. }
  336. .left-col {
  337. margin-right: 30px;
  338. width: 400px;
  339. }
  340. @media screen and (max-width: 650px) {
  341. .left-col {
  342. display: none;
  343. }
  344. }
  345. ul.profile-choices>li {
  346. list-style: none;
  347. border-radius: 5px;
  348. overflow: hidden;
  349. height: 50px;
  350. }
  351. ul.profile-choices>li a {
  352. padding: 5px 10px;
  353. font-size: 20px;
  354. line-height: 40px;
  355. font-weight: lighter;
  356. color: #fff;
  357. display: flex;
  358. flex-direction: row;
  359. justify-content: space-between;
  360. transition-duration: 0.5s;
  361. height: 50px !important;
  362. }
  363. ul.profile-choices>li a:after {
  364. content: "chevron_right";
  365. font-family: "Material Icons";
  366. font-size: 20px;
  367. margin-right: 10px;
  368. }
  369. ul.profile-choices>li a:hover {
  370. color: #000;
  371. text-decoration: none;
  372. background-color: rgba(255, 255, 255, 0.2039215686);
  373. }
  374. .pickr {
  375. display: inline-block;
  376. margin-right: 6px !important;
  377. }
  378. .profile-des {
  379. font-family: "Open Sans", sans-serif;
  380. font-size: 25px;
  381. font-weight: normal;
  382. margin: 5px 0px;
  383. color: #fff;
  384. }
  385. details {
  386. margin-left: 0px !important;
  387. }
  388. .accordions {
  389. margin-top: 100px;
  390. }
  391. .sub-title {
  392. font-family: "Open Sans", sans-serif !important;
  393. font-size: 14px;
  394. letter-spacing: 5px;
  395. }
  396. b {
  397. font-weight: 500 !important;
  398. font-size: 22px !important;
  399. }
  400. i {
  401. font-size: 14px;
  402. margin-bottom: 130px !important;
  403. border-bottom: 1px solid #fff;
  404. }
  405. ul {
  406. margin-top: 20px !important;
  407. margin-bottom: 50px !important;
  408. }
  409. ul>li {
  410. list-style: none;
  411. font-size: 16px;
  412. line-height: 20px;
  413. }
  414. h2.m-text {
  415. font-size: 30px;
  416. margin-left: 0px;
  417. font-weight: normal;
  418. }
  419. .desc-block {
  420. opacity: 1;
  421. transition-duration: 0.4s;
  422. overflow: none;
  423. }
  424. .desc-block-hidden {
  425. display: none;
  426. }
  427. .desc-active {
  428. text-decoration: none;
  429. background-color: rgba(255, 255, 255, 0.2039215686);
  430. }
  431. .desc-active a {
  432. color: #000;
  433. }
  434. ul.m-text {
  435. margin-top: 10px !important;
  436. }
  437. /* The Overlay (background) */
  438. .overlay {
  439. /* Height & width depends on how you want to reveal the overlay (see JS below) */
  440. height: 0%;
  441. width: 100%;
  442. position: fixed;
  443. /* Stay in place */
  444. z-index: 1100;
  445. /* Sit on top */
  446. left: 0;
  447. top: 0;
  448. background-color: rgb(0, 0, 0);
  449. /* Black fallback color */
  450. background-color: rgba(0, 0, 0, 0.9);
  451. /* Black w/opacity */
  452. overflow-x: hidden;
  453. /* Disable horizontal scroll */
  454. transition: 0.5s;
  455. /* 0.5 second transition effect to slide in or slide down the overlay (height or width, depending on reveal) */
  456. }
  457. /* Position the content inside the overlay */
  458. .overlay-content {
  459. position: relative;
  460. height: 100%;
  461. top: 25%;
  462. /* 25% from the top */
  463. width: 100%;
  464. /* 100% width */
  465. text-align: center;
  466. /* Centered text/links */
  467. margin-top: 30px;
  468. /* 30px top margin to avoid conflict with the close button on smaller screens */
  469. }
  470. /* The navigation links inside the overlay */
  471. .overlay a {
  472. padding: 8px;
  473. text-decoration: none;
  474. font-size: 18px;
  475. color: white;
  476. display: block;
  477. /* Display block instead of inline */
  478. transition: 0.3s;
  479. /* Transition effects on hover (color) */
  480. }
  481. .overlay h1 {
  482. color: white;
  483. font-size: 20px;
  484. font-weight: lighter;
  485. margin-bottom: 10px;
  486. text-decoration: underline;
  487. }
  488. /* When you mouse over the navigation links, change their color */
  489. .overlay a:hover,
  490. .overlay a:focus {
  491. color: #f1f1f1;
  492. }
  493. /* Position the close button (top right corner) */
  494. .overlay .closebtn {
  495. position: absolute;
  496. top: 20px;
  497. right: 45px;
  498. font-size: 60px;
  499. }
  500. </style>
  501. <?php get_footer(); ?>